Wordpress动态补充工具栏不显示窗口小部件

时间:2011-08-17 19:45:18

标签: php wordpress

我的wordpress网站有三个动态侧边栏。 Sidebars 1和2工作正常,但第3(类别)将接受小部件并在网站上显示它们但是当我回去在wp admin中编辑它们时,它会删除它们。关于这个问题的任何想法?

<?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
                )
            );
        }
    }
?>

1 个答案:

答案 0 :(得分:2)

id的“类别”拼写错误是否可能导致问题?