Forums

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

  1. shafee85
    Member
    Posted 2 weeks 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
    moderator
    Posted 2 weeks 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 weeks ago #

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

Reply

You must log in to post.

About this Topic