0
我有三個動態的邊欄爲我的WordPress的網站。側邊欄1和2工作得很好,但第三個(類別)將接受小部件並在網站上顯示它們,但是當我回去在wp admin中編輯它們時,它將刪除它們。關於這個問題的任何想法?WordPress的動態邊欄不顯示小部件
<?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,
'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
)
);
}
}
?>
就是這樣,謝謝! – ok1ha