Multiple Widget Problem
-
I am trying to use 8 widgets in different areas in my theme. I have registered the widgets in functions.php which look like this:
<?php //register widgets register_sidebar(array('name'=>'Banners 1', 'before_widget' => '<div id="banners-1">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '', )); //register widgets register_sidebar(array('name'=>'Sidebar 1', 'before_widget' => '<div id="sidebar-1">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>', )); register_sidebar(array('name'=>'Sidebar 2', 'before_widget' => '<div id="sidebar-2">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>', )); register_sidebar(array('name'=>'Sidebar 3', 'before_widget' => '<div id="sidebar-3">', 'after_widget' => '</div>', 'before_title' => '<div class="somediv"></div><h3>', 'after_title' => '</h3>', )); register_sidebar(array('name'=>'Footer 1', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h3>', 'after_title' => '</h3>', )); register_sidebar(array('name'=>'Footer 2', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h3>', 'after_title' => '</h3>', )); register_sidebar(array('name'=>'Footer 3', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h3>', 'after_title' => '</h3>', )); ?>
Then in my pages I call these widgets one by one using:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Banners 1') ) : ?><?php endif; ?>
and specifying the names accordingly.Now the problem I have is that when I am in the admin area of my site I drag the widgets I want to use to the designated areas, but when I refresh or return to the widgets area later, my widgets have dissapeared or are in different widgets.
For example: I set a recent post widget in sidebar 1, only to find it in sidebar 2 or 3 later.
Am I registering my widgets incorrectly?
- The topic ‘Multiple Widget Problem’ is closed to new replies.