Hello,
I'm replacing thematic_sidebar() on a few template pages with a wp_nav_menu. I found the code here Chris wrote to use is_page_template to zero in on specific page templates. However, the action hook is affecting the entire site, and I'm losing my sidebar in my blog pages as well. GRRRR!
Here's my functions:
// Register the new menus
function register_my_menus() {
register_nav_menus(
array(
'primary-menu' => __( 'Primary Menu' ),
'products-menu' => __( 'Products Menu' ),
'about-menu' => __( 'About Us Menu' ),
)
);
}
add_action( 'init', 'register_my_menus' );
function products_menu_sidebar() {
if (is_page_template('products.php')) {
wp_nav_menu( array(
'theme_location' => 'products-menu',
'container_id'=>'products-menu',
'container_class' => 'left-menu-container',
'menu_class' => 'left-menu',
'depth' => '0',
) );
} else {
//nada
}
}
add_action('thematic_sidebar', 'products_menu_sidebar');
So the nav menu is showing up on the products.php templated pages. However, on other pages that are using the Blog template, my sidebar is missing.
What the heck am I doing wrong here?!