Forums

[resolved] Categories & Organization (14 posts)

  1. onecigaraweek
    Member
    Posted 4 months ago #

    Hello,

    I've been running a cigar review website for the past couple of months using wordpress, and I'm trying to streamline the design so the sidebars and main page do not feel so cumbersome.

    The problem I am having is in the nature of Categories; I would like only the top level Categories to be displayed on the sidebar. Basically it would run something like this:

    Reviews
    By Cigar Brand
    By Country of Origin

    From their a page would be displayed listing the child categories, which in this case would be cigar brands/countries, that would then lead to yet another set of child categories.

    Please advise on your thoughts.

    ~Thanks
    Onecigaraweek

  2. esmi
    Member
    Posted 4 months ago #

    Use wp_list_categories with the depth parameter set to 1 for the top nav - eg:

    <?php wp_list_categories('title_li=&depth=1');?>

    To display the sub-categories on the main category listings, see: http://codex.wordpress.org/Template_Tags/wp_list_categories#Only_Show_Children_of_a_Category

  3. onecigaraweek
    Member
    Posted 4 months ago #

    Ok, so I modified the <?php wp_list_categories('title_li=0');?> in the sidebar.php.

    Seems like the addition of "&depth=1" is not working. The sidebar still displays the child category.

  4. esmi
    Member
    Posted 4 months ago #

    Try <?php wp_list_categories('title_li=&depth=1');?>

  5. onecigaraweek
    Member
    Posted 4 months ago #

    That's exactly how I modified the code.

  6. esmi
    Member
    Posted 4 months ago #

    It has always worked fine for me. Can you post just that piece of code?

  7. onecigaraweek
    Member
    Posted 4 months ago #

    hrmmm...

    <li class="widget">
    <h2>Categories</h2>
    <ul>
    <?php wp_list_categories('title_li=&depth=1');?>
    </ul>
    </li>

    EDIT: had some problems with pasting the code; here it is.
    The code is supposed to go into sidebar.php correct?

  8. esmi
    Member
    Posted 4 months ago #

    Have you enabled the Categories widget in Admin/Appearance/Widgets? If so, none of the code changes to sidebar.php will have an effect.

  9. onecigaraweek
    Member
    Posted 4 months ago #

    Yes; so then if that is the case, where do I need to make the changes?

  10. esmi
    Member
    Posted 4 months ago #

    Can you drop a copy of your sidebar.php file into the WordPress pastebin? It's probably easier for me to make the changes that try to talk you through them.

    The only downside to this is that, if you are using widgets elsewhere on your sidebar for Pages or Recent Comments etc., your choice of placement for the Category list is either at the top (above your widgets) or at the bottom (below your widgets). Which would you prefer?

  11. onecigaraweek
    Member
    Posted 4 months ago #

    Put it at the top; that's where I planned to place it anyway, so it's not really a downside.

    http://wordpress.pastebin.ca/1485007

    This will be give me the ability to veiw a page with a list of child categories/pages right? I mean basically I am looking to do the following:

    Parent Menu
    Ratings by Brand (Click)
    List of Brands ([New Page]Made up of Child categories)
    List of Lines ([New Page] Links made up of posts)

    Maybe I need to go about this another way; as far as the site goes right now, you click on a category and you get whole articles. I'd like to use the system more as a dynamic directory if you get what I'm saying.

  12. esmi
    Member
    Posted 4 months ago #

    New sidebar code: http://wordpress.pastebin.ca/1485030

    Make a backup copy of your current sidebar (name it something like sidebar.php.bak) just in case and then replace the sidebar code with the above.

    The next step is to look for the best place/method to list your sub-categories. Can you post a link to your site?

    I'm about to log off for the day but feel free to email me at esmi at quirm dot net to remind me that I need to get back to this tomorrow.

  13. onecigaraweek
    Member
    Posted 4 months ago #

    Just wanted to bump this back up to see if anyone is out there that can help me.

    Like I stated earlier I would like the category links to act as a directory to child categories and articles rather than just posting whatever articles are relevant to the page. This still has not been resolved.

  14. onecigaraweek
    Member
    Posted 4 months ago #

    Found A-Z index and it seems to do what I'm asking.

Reply

You must log in to post.

About this Topic

Tags