Created
June 26, 2013 10:18
-
-
Save Thielo/5866374 to your computer and use it in GitHub Desktop.
Quick Snippet to display Wordpress Categories.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$getCategoriesArgs = array('orderby' => 'name','parent' => 0); | |
$getCategories = get_categories($getCategoriesArgs); | |
if(count($getCategories) > 0){ | |
echo '<ul>'; | |
foreach ( $getCategories as $category ) { | |
echo '<li><a href="'.get_category_link($category->term_id).'">'.$category->name.'</a></li>'; | |
} | |
echo '</ul>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment