WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how to display the sub_categories (3 posts)

  1. holylone
    Member
    Posted 5 years ago #

    hello!

    i want to add the sub category list in each category

    here is my code

    <?php wp_list_cats('hide_empty=0&child_of=XXX'); ?>

    i get the category from the_category_ID()

    and how can i put the ID vaule into child_of

    or have to use the if else to rolve this problem?

    thanks

  2. deanes02
    Member
    Posted 5 years ago #

    <?php wp_list_categories('child_of='.$_GET[cat].'); ?>

    This works if your permalink structure is set to "default". IT takes the category number from the web address.

    Hope this helps.

  3. holylone
    Member
    Posted 5 years ago #

    thanks to deanes02

    i have resloved this problem under your help

    but what is the difference between wp_list_categories() and wp_list_cats()?

Topic Closed

This topic has been closed to new replies.

About this Topic