Yes Trinity13, the client has a restaurant with a few different locations. Each location has its own specials and events, etc.. I would like to keep the main navigation the same throughout and have a different sidebar for each location sub section.
In the other theme I used (abrax) there was simply an option on the page edit screen to select which sidebar to use for which page. All I needed to do was register a new one in functions.php and and I was good to go with just the single sidebar.php in my theme folder.
I’ve never made a theme before so I’m not totally familiar with the ins and outs wordpress.
When you say that I need to make a new template for the sidebar, do you mean a sidebar-2.php or something like that? Or do you mean that I would need to create a new page template that calls something like get_sidebar(‘sidebar-2’);?
This theme is quite a bit simpler than the one I’ve worked with in the past so hopefully it will give me an opportunity to learn a bit more wordpress.
Here is my current sidebar.php if it is of any help:
<div id="sidebar" class="grid_8">
<div class="gutter20">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
<?php endif; ?>
</div>
</div><!-- end sidebar -->
<div class="clear"></div>
and here is my functions.php:
<?php
// SIDEBAR
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'location2',
'id' => 'location2',
'description' => 'Sidebar for location2',
'before_widget' => '<div style="height: 280px"></div><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}
// CUSTOM MENUS
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'pluginbuddy_mobile' => 'PluginBuddy Mobile Navigation Menu',
'foot_menu' => 'My Custom Footer Menu'
)
);
}
// EXCERPT
function new_excerpt_length($length) {
return 20;
}
add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_more($more) {
global $post;
return ' <a class="excerpt-more" href="'. get_permalink($post->ID) . '">' . 'More»' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
// Add Read More link to manual excerpts.
add_action('the_excerpt', 'child_add_manual_read_more', 20);
function child_add_manual_read_more($excerpt) {
if ( has_excerpt() ) {
// Trim the newline.
$excerpt = rtrim($excerpt);
// Check for the <p> tags
if ( '<p>' == substr($excerpt, 0, 3) && '</p>' == substr($excerpt, -4) )
$excerpt = sprintf( '<p>%s <a href="%s" rel="nofollow" class="morelink">More?</a></p>', substr($excerpt, 3, -4), get_permalink() );
}
return $excerpt;
}
?>
location2 is the sidebar that I just registered but have yet to make a template file.