Custom Sidebars
-
Ok I have a home page that is id=1 that has no sidebar but a widgeted footer.
I have Pages with a Page template<?php get_sidebar('Page Sidebar'); ?>
to call the sidebar in that template
and a template for my blog or new posts page<?php get_sidebar(); ?>
which is getting the regular side bar
my sidebar.php is
<?php if ( is_page('6')) { include(TEMPLATEPATH . '/sidebar-blog.php'); } elseif ( is_page('1')) { include(TEMPLATEPATH . ''); } else { include(TEMPLATEPATH . '/sidebar-pages.php'); } ?>
so the blog is page 6 home page 1 (page id not order)
functions.php<?php if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Right Sidebar', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h2>', 'after_title' => '</h2>', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Footer', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h2>', 'after_title' => '</h2>', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Page Sidebar', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h2>', 'after_title' => '</h2>', )); >
and i can edit all 3 sidebars in widgets admin easy peasey
All sidebars seem to be working AS i want them .. until i change the reading settings and make a static home page of Home .. and hence call my Posts page as the Blog page.
When I do that all of a sudden all pages including Blog have the same regular sidebar on them .. am i doing somethign wrong .. as it works without static home page i thought I had got it right .. but once i make it static .. it stops working .. any help greatly welcome !
- The topic ‘Custom Sidebars’ is closed to new replies.