I have three dynamic sidebars for my wordpress site. Sidebars 1 and 2 work just fine but the 3rd (categories) will accept widgets and display them on the site but when I go back to edit them in wp admin, it removes them. Any ideas on this problem?
<?php
// Sidebars
add_action( 'widgets_init', 'my_register_sidebars' );
if (function_exists('register_sidebars')){
function my_register_sidebars() {
// Widgets
$before_widget = '<div id="%1$s" class="events %2$s">';
$before_title = '<div class="purpleBarSpace"><span class="purpleBar">';
$after_title = '</span></div>';
$after_widget = '</div>';
/* Home Sidebar */
register_sidebar(
array(
'id' => 'Home',
'name' => __( 'Home' ),
'description' => __( 'Sidebar for Homepage.' ),
'before_widget' => $before_widget,开发者_如何学C
'after_widget' => $after_widget,
'before_title' => $before_title,
'after_title' => $after_title
)
);
/* General Sidebar */
register_sidebar(
array(
'id' => 'General',
'name' => __('General'),
'description' => __('All Purpose sidebar'),
'before_widget' => $before_widget,
'after_widget' => $after_widget,
'before_title' => $before_title,
'after_title' => $after_title
)
);
/* Category Sidebar */
register_sidebar(
array(
'id' => 'Catgories',
'name' => __('Categories'),
'description' => __('Sidebar for Categories Page'),
'before_widget' => $before_widget,
'after_widget' => $after_widget,
'before_title' => $before_title,
'after_title' => $after_title
)
);
}
}
?>
Is it possible that the misspelling of "categories" for the id is causing trouble?
精彩评论