Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the children categories of a category
<?php $catname =single_cat_title("",false);
$catId= get_cat_ID($catname);?>
<ul>
<?php
wp_list_categories("orderby=id&show_count=0&use_desc_for_title=1&child_of=$catId");
?>
</ul>
@kuratowsky

This comment has been minimized.

Show comment
Hide comment
@kuratowsky

kuratowsky May 27, 2012

Use single_cat_title() instead wp_title(). The first is more secure than wp_title(). The whole of SEO plugins can change the title, and use the wp_title() method to do this. If title!=category name don't causes an error, but you can see all of the categories of your blog.

Owner

kuratowsky commented May 27, 2012

Use single_cat_title() instead wp_title(). The first is more secure than wp_title(). The whole of SEO plugins can change the title, and use the wp_title() method to do this. If title!=category name don't causes an error, but you can see all of the categories of your blog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment