Forums

[resolved] How to create create child categories and dispay them on the sidebar? (3 posts)

  1. shafee85
    Member
    Posted 2 years ago #

    Hi,

    I have created a category called BLOG and when entering into this category, i need to be able to show on the sidebar only the child categories of the parent Category BLOG.

    What code should i insert in the sidebar.php file?

    Currently i have inserted
    <?php wp_list_categories('orderby=id&include=50&title_li='); ?>

    but it only display the parent category there.

    Can anyone please tell me how i could get only the child categories displayed?

    Thanks in advance.

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    <?php wp_list_categories('orderby=id&child_of=50&title_li='); ?>

    See the template tag, wp_list_categories(), for more info.

  3. shafee85
    Member
    Posted 2 years ago #

    Awesome! it works perfectly. Thank you MichaelH. You have helped me many times :) WordPress is by far the best support community out there.

Topic Closed

This topic has been closed to new replies.

About this Topic