Forums

Displaying only certain categories (5 posts)

  1. prb81
    Member
    Posted 2 years ago #

    On my sidebar is a list of Categories used but I was hoping to only display parent categories.

    For example: If I have a category called SPORT and a subcategory called BASEBALL and SOCCER, can I set it up so that my sidebar only shows the parent category: SPORT?

    Also is it possible only only select say a post on BASEBALL without checking the SPORT category but for it to count towards SPORT also without having to check it. For example, if I post 10 articles in just BASEBALL and 1 under SPORT only, it displays it as: SPORT (1) but when you click on it, it lists all 11 articles from BASEBALL and SPORT.

    A little confusing I know but hopefully someone has the answer to both questions.

    Thanks!!

  2. prb81
    Member
    Posted 2 years ago #

    Just bumping this up incase any of the resident experts have missed it. Posts come thick and fast in here!!!

  3. Edward Caissie
    Member
    Posted 2 years ago #

    Using wp_list_categories() with the parameter depth=1 will only show "parent" categories. Have a read of this codex page: http://codex.wordpress.org/Template_Tags/wp_list_categories

    Hopefully that will get you started ...

  4. craigmn3
    Member
    Posted 1 year ago #

    I Am trying to do the same thing

    Okay Along these same lines I have changed my category-template code so that depth equals 1 and it is still showing a child template.

    In my theme "simple green", the children show up as parents, with no indentation and below all the other parents

    Any ideas here?

  5. esmi
    Theme Diva & Mod
    Posted 1 year ago #

    @craigmn3: Post a new topic.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags