WordPress show all categories in template

Code Examples, Wordpress

WordPress show all categories in template

$categories = get_categories();

foreach($categories as $category) {
   echo '<p><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></p>';
}

click for more WordPress codes, read in detail about WordPress Categories