• When I drag and drop a widget into the sidebar in admin, I am unable to edit the text in the widget unless I click “save” first. It is only symptomatic of the theme that I’m developing. (I’m learning how to make my own.) I even took out all of the code, merged it into index.php and functions.php to attempt to resolve it. There are no plugins installed, though, when they were, they did not conflict with Twenty-Thirteen.

    Here is my bare-bones code for index.php:

    [ Moderator note: Code fixed, please wrap code in backticks or use the code button. ]

    <html>
    <head><?php wp_head(); ?></head>
    <body>
    <?php get_sidebar(); ?>
    <?php wp_footer(); ?>
    </body>
    </html>
    
    And my code in functions.php:
    <?php
    
    /**
     * Register sidebars.
     *
     * Registers our main widget area and the front page widget areas.
     *
     * @since Twenty Twelve 1.0
     */
    function twentytwelve_widgets_init() {
    	register_sidebar( array(
    		'name' => __( 'Main Sidebar', 'dummy' ),
    		'id' => 'sidebar-1',
    		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    
    	register_sidebar( array(
    		'name' => __( 'First Front Page Widget Area', 'dummy' ),
    		'id' => 'sidebar-2',
    		'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    
    	register_sidebar( array(
    		'name' => __( 'Second Front Page Widget Area', 'dummy' ),
    		'id' => 'sidebar-3',
    		'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    }
    add_action( 'widgets_init', 'twentytwelve_widgets_init' );
    
     ?>

    Could somebody please help me figure out why the sidebar continues to automatically collapse? There is virtually no code that could conflict with it. Thanks

  • The topic ‘Widgets in admin automatically collapse and won't edit’ is closed to new replies.