• Resolved ontheinternets

    (@ontheinternets)


    After spending much time trying to figure out how to do this and searching every resource available I am hoping someone has encountered this issue and has some input.

    Like the topic title says I would like to have a sidebar for static pages and a sidebar for ANY page related to the blog. I have almost achieved this by using.

    <?php
    if ( is_page() || is_page('50'))  {
        get_sidebar();
    } else {
        get_sidebar('blog');
    }
    ?>

    This almost did it but the problem I have ran into is apparently it thinks “categories” are is_page. Also, the page with the ID of 50 is my home page. For whatever reason the is_home did not work. I am using a static page for my home and have my blog set to another static page in the reading settings.

    I am aware that I can use a custom template but really do not want to have to set a custom template for EVERY page. Has anyone done this? Am I missing a is_blog condition? The goal is simple enough, Use sidebar A for any static pages use sidebar B for any thing related to the blog (categories, archive, etc.) What am I missing?

Viewing 1 replies (of 1 total)
  • Thread Starter ontheinternets

    (@ontheinternets)

    nevrmind, I am a idiot, didn’t replace

    get_sidebar();

    with

    `
    if ( is_page() || is_page(’50’)) {
    get_sidebar();
    } else {
    get_sidebar(‘blog’);
    }`
    in my archive.php and archives.php template files.

Viewing 1 replies (of 1 total)
  • The topic ‘1 Sidebar for static pages 1 for blog?’ is closed to new replies.