Parent Category page and Children Category page (4 posts)

  1. jumust
    Posted 4 years ago #

    I want to use a conditional like: if is the parent category pages show the sidebar "parent", if is children category pages show the sidebar "children".

    I have trouble to create the conditional for this. Should I make two different templates one for parent and one for children, the issue is always how to call them?

  2. You could use the function in_category() or is_category()...

    Have a look at this post that I wrote a while back -

    Also have a look at this - http://codex.wordpress.org/Conditional_Tags#A_Category_Page

  3. jumust
    Posted 4 years ago #

    Actually I don't want to use any category number otherwise I gotta update the code everytime I create a new category. I just want it to work for all current category pages.

    EXAMPLE: Category Parent --> A
    Children --> b,c,d,e,f

    Category Parent --> Z
    Children --> t,v,u

    If it's any parent category page (it means A,Z,.....) or if it's any children category (b,c,d,e,f,t,v,u,....)

    Sorry don't know if I was clear, I don't know how to do...

  4. deepbevel
    Posted 4 years ago #

    maybe thiswill help.

Topic Closed

This topic has been closed to new replies.

About this Topic