开发者

Wordpress Dynamic Sidebar does not show widgets [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜