How to use multiple sidebars – getting them in different page tmeplates
-
Ok, I’m at a loss here. I’ve tried just about everything I can think of…
I am trying to create different sidebars and insert them in different page templates so that there is a different sidebar for a specific page. I have created page-2.php, page-3.php, and page-4.php, have uploaded them into my themes folder, and have named them properly so that they show up under the ‘templates’ dropdown menu under the ‘edit page’ page. So I believe the page templates are good. I also have created sidebar-2.php, sidebar-3.php, and sidebar-4.php, have uploaded them into my themes folder, and they show up under ‘templates’ under the ‘edit themes’ page. So I think the sidebars are ok. The problem I am having is getting the correct html coding in the functions.php file. I have copy and pasted multiple versions of html that says it will create multiple sidebars, but it never works. I’m not quite sure exactly where in the html to out it either. Here is the current html for the sidebar section in my functions.php file:
<?php if ( ! isset( $content_width ) ) $content_width = 603; function naturefox_sidebar() { register_sidebar(array( 'name' => __( 'Sidebar Widget Area', 'naturefox' ), 'id' => 'sidebar-widget-area', 'description' => __( 'The sidebar widget area', 'naturefox' ), 'before_widget' => '<li>', 'after_widget' => '</li>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); } add_action('widgets_init', 'naturefox_sidebar');
[Please post code or markup snippets between backticks or use the code button.]
Help! Thanks!
- The topic ‘How to use multiple sidebars – getting them in different page tmeplates’ is closed to new replies.