wordpress - Child category list on the sidebar -



wordpress - Child category list on the sidebar -

good day can 1 help me need sub categories associated post , set on widget list in sidecar how can this? how illustration computers main category child/subcategory monitor , cpu etc.

computers (main category)

monitor processor harddrive psu memory

now if have post lets have article "hp e241i review" on sidebar need have list of child/ sub category associated post, monitor, processor, harddrive, psu , memory. possible appreciate help

edit here used issue need main category id of article place within "parent" array replacing "category id" don't know how

<?php $args = array( 'orderby' => 'name', 'parent' => 'category id', 'hide_empty' => 1 , ); $categories = get_categories( $args ); $content=''; foreach ( $categories $category ) { echo '<a href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a> <br/>'; } ?>

to list categories including sub categories utilize <?php echo get_the_category_list();?>, print categories , sub categories

wordpress

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -