Custom page template displays wrong sidebar template
-
Hello, My problem is with a new page template that I created to help resolve a conflict between two plugins. The template, page-calendar.php, is supposed to use a the sidebar template, sidebar-calendar.php, but it is using the default sidebar template instead.
I’ve added the following code to functions.php.
register_sidebar(array( 'name' => 'Calendar Sidebar', 'id' => 'calendar', 'description' => 'These are widgets for the calendar page sidebar.', 'before_widget' => '<div id="%1$s" class="cal-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ));
the code in my sidebar template (sidebar-calendar.php) is as follows.
<aside id="right-sidebar" class="cf"> <?php if (is_active_sidebar('calendar')) { dynamic_sidebar('calendar'); } ?> </aside>
And the code that calls the sidebar from page-calendar.php is:
<?php get_sidebar('calendar'); ?>
I have another custom sidebar that works as advertised, but I can’t seem to track down the problem with this one. The page that is causing the problem as at .
I hope I have supplied enough information, please let me know if there are any questions.
Thanks,
Randy
- The topic ‘Custom page template displays wrong sidebar template’ is closed to new replies.