Forums

[resolved] A question about expanding categories in the sidebar. (7 posts)

  1. MellowToad
    Member
    Posted 5 years ago #

    Hi folks,

    I’m relatively new to WordPress and am having a problem with my sidebar. I hope that I posted this in the correct forum department and that I have worded it correctly, if not I apologize in advance. For some reason, I can’t seem to get my sidebar to list my categories in expanded form, showing it’s children.

    As an example, I want this:

    Food
    --Recipes
    --Ingredients
    Reviews
    --Beers
    --Movies
    --Video Games
    Uncategorized

    But I’m instead getting this:

    Food
    Reviews
    Uncategorized

    I’ve searched Google and this site and have found a few things, most of it has been stuff that I’ve not 100 percent understood, but nothing that has really seemed to help. Do any of you know how I can go about fixing this? Thanks so much.

  2. Chris_K
    Member
    Posted 5 years ago #

    Have a look at your theme's sidebar (assuming that's where the list is?) and see if it is using wp_list_cats to display the category list.

    If it is, click that link and check the options.

    If that doesn't make a lot of sense, paste in your wp_list_cat() statement here and we'll see if we can suggest how to change it.

  3. MellowToad
    Member
    Posted 5 years ago #

    I tried out that link that you suggested and changed my wp_list_cats arguement to "children" and it didn't have any effect.

    Here's my catagory info plus some other stuff:

    <h2> <?php _e('Categories'); ?>
    </h2>
    <ul>
    <?php wp_list_cats('children'); ?>
    </ul>
    <?php if ( is_home() || is_page() || is_single() ) { ?>
    <?php get_links_list(); ?>
    <?php } ?>

  4. Chris_K
    Member
    Posted 5 years ago #

    Maybe try:

    <?php wp_list_cats('hierarchical=1&children=1'); ?>

  5. MellowToad
    Member
    Posted 5 years ago #

    Actually, while testing it, I found that if I plug in "hierarchical" as the argument, it fixes it. So for all reasons, this is solved. Thanks much.

  6. moshu
    Member
    Posted 5 years ago #

    So for all reasons, this is solved.
    Then you should change its status from "not resolved" to "resolved" (up under the title).

  7. MellowToad
    Member
    Posted 5 years ago #

    Sorry, I'm at work and it took me a bit to get back. Will do.

Topic Closed

This topic has been closed to new replies.

About this Topic