WordPress.org

Ready to get started?Download WordPress

Forums

Categories and Subcategories (2 posts)

  1. bundy1985
    Member
    Posted 6 years ago #

    Hi,

    I was wondering if it were possible to have subcategories in the sidebar.
    So this is how my side bar should look like:

    SEARCH
    -------------
    [Search field]

    CLIENTS
    -------------
    -Client 1 (5)
    -Client 2 (1)
    -Client 3 (6)

    WORK
    -------------
    -Web (10)
    -Print (1)
    -Motion (1)

    FUN
    -------------
    -Pics (5)
    -Movies (2)
    -Art (2)

    COMMENTS
    -------------
    -Comment
    -Comment
    -Comment

    So actually I want to be able to create categories that are displayed as the other widgets and then create a subcategory in each of those widgets...

    Is this possible?

    Greets,
    Bundy

  2. emmi
    Member
    Posted 6 years ago #

    Hi!
    Yes, you can have subcategories in the sidebar.
    Do you want to list the subcategories for each parent category in separate lists with the name of the parent category as the title?

    Then you can put some code like this in your sidebar. Change the "child_of=numbers" to the number of the parent category.

    <h2>WORK</h2>
    
    <?php wp_list_categories('title_li=0&show_count=1&child_of=1'); ?>
    
    <h2>FUN</h2>
    
    <?php wp_list_categories('title_li=0&show_count=1&child_of=2'); ?>

    If you want widgets, you can try:
    http://wordpress.org/extend/plugins/wordpress-navigation-list-plugin-navt/

Topic Closed

This topic has been closed to new replies.

About this Topic