Created
December 18, 2012 00:11
-
-
Save bencooling/4323655 to your computer and use it in GitHub Desktop.
Wordpress Taxonomy related snippets
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
/* List child categories | |
---------------------------------------------------------------------------------------------------------*/ | |
<?php | |
$args = array('parent' => get_query_var('cat'), 'hide_empty' => false); | |
$categories=get_categories($args); | |
foreach($categories as $category) { | |
echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> '; | |
echo '<p> Description:'. $category->description . '</p>'; | |
echo '<p> Post Count: '. $category->count . '</p>'; } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment