WordPress.org

Ready to get started?Download WordPress

Forums

Display Subcategories in Sidebar (4 posts)

  1. jmz360
    Member
    Posted 5 years ago #

    I have a category in my wordpress installation called 'Activities'. I would like to display any subcategories of the activities category in my sidebar, is this possible?

    Ideally, I'd also like to display the titles of the posts in each sub category aswell but this might be asking a bit much.

  2. doc4
    Member
    Posted 5 years ago #

    jmz360,

    Try something such as:

    <ul>
     <?php wp_list_categories('title_li=&include=12'); ?>
      <ul>
       <?php wp_list_categories('title_li=&child_of=10&show_count=1'); ?>
      </ul>
    </ul>
  3. jmz360
    Member
    Posted 5 years ago #

    Great, thanks.

  4. MaddTechWF
    Member
    Posted 4 years ago #

    I noticed that this post is similar to what I was looking for. I'm hoping that there is a way that I can use the above code but have it the subcategories of the current page selected. I have the code placed in the sidebar via a PHP Text Widget.

Topic Closed

This topic has been closed to new replies.

About this Topic