WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Sidebar trouble (2 posts)

  1. Jay Hoffmann
    Member
    Posted 3 years ago #

    I am trying to get my sidebar to work, but it simply won't. The code is pretty basic:
    In my functions I have:

    function padd_widgets_init() {
    	register_sidebar(array(
    		'name' => 'Sidebar',
    		'before_widget' => '<div id="%1$s" class="box %2$s">',
    		'after_widget' => '</div></div>',
    		'before_title' => '<div class="title"><h3>',
    		'after_title' => '</h3></div><div class="interior">',
    	));
    }
    add_action('widgets_init','padd_widgets_init');

    The sidebar.php file looks like this:

    <div id="sidebar">
    	<div class="pad">
    		<h2>Sidebar</h2>
    
    	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>
    
    	<?php endif; ?>
    
    	</div>
    </div>

    And the page.php contains <?php get_sidebar(); ?> but I have also tried <?php get_sidebar('Sidebar'); ?> to no avail.

    Am i doing something wrong?

  2. chriseverson
    Member
    Posted 3 years ago #

    I didn't test this code, but maybe try naming it something different? Sidebar seems like a name that might conflict with defaults.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.