Last active
September 16, 2017 00:15
-
-
Save pablocattaneo/6efffbbe9760feaada48 to your computer and use it in GitHub Desktop.
Returns subcategories (categories child) from a specific term.
This file contains hidden or 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
<ul> | |
<?php | |
$categoryID = get_category_by_slug( 'blog' ); /*Retrieve category object by category slug*/ | |
$categoryID = $categoryID ->term_id; /*Get the term id*/ | |
$args = array( | |
'child_of' => $categoryID, | |
'title_li' => __( '' ) | |
); | |
wp_list_categories( $args ); /*Display or retrieve the HTML list of categories.*/ | |
?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment