Support » Fixing WordPress » Sidebar for Category Child Page

  • Resolved scottcarlton


    I was wondering if there was a way to get a custom sidebar to show up in a child category of the parent.

    The pages ei and all show the custom sidebar. dosen’t. These pages are independent of the blog.
    So if I change category.php to the custom sidebar it changes in the blog categories too.

    Since I will be adding child categories to the parent (press) and not knowing what those might be in advanced, making a category-(term).php dosen’t work. Is there a way to get the custom sidebar to show up for any child listed under the parent of (press).

    Sorry if this sounds confusing. Tried to explain it the best I could.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Create a page template (preferably in a child theme) and assign it each chld page.

    Thanks for the quick reply, that was my first option. Unforchantely I don’t know what each child will be because the client will add children as press articles are posted. So I need an archive category that will apply the custom sidebar to any child that will fall under the parent (press). Not sure if that sounds clear though.

    Solved! It turned out to be pretty easy.

    <?php if (in_category('press')) get_sidebar('press');
    else get_sidebar('home');?>

    Now I have to go research why my navigation won’t show up on my category pages.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sidebar for Category Child Page’ is closed to new replies.