Skip to content

Instantly share code, notes, and snippets.

@kuratowsky
Created May 7, 2012 17:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kuratowsky/2628983 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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