• Hi there,
    I’m trying to display a dynamic sidebar I’ve created on a custom page template.

    I’ve added this to functions:

    if ( function_exists('register_sidebar') ) {
    	register_sidebar(array(
    		'name' => 'Shop Sidebar',
    		'id' => 'shop-sidebar',
    		'description' => 'Sidebar on Shop Pages',
    		'before_widget' => '<li id="%1$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h2>',
    		'after_title' => '</h2>',
    	));
    }

    I’ve created a sidebar-shop.php with the following:

    <p>shop sidebar file</p>
    <div id="secondary" class="sidebar-container" role="complementary">
    	<div class="widget-area">
    		<?php dynamic_sidebar( 'shop-sidebar' ); ?>
    	</div><!-- .widget-area -->
    </div><!-- #secondary -->

    And on my page template, I’ve added this:

    <?php get_sidebar('shop'); ?>

    Its getting the correct sidebar-shop file, because I’m getting the ‘shop sidebar file’ paragraph at the top, but the actual widgets I’ve dragged onto this sidebar don’t appear.

    Could anybody help please?

    Thanks,
    Craig

The topic ‘Dynamic Sidebar Issue’ is closed to new replies.