• Hi! I have tried following several sets of instructions but have been unable to (fully) successfully place a widget area in the header of my twenty eleven theme. Please follow the link to my site domundocoaching.com. Here you’ll see that I have managed to make a header widget area in wordpress where I can then load the social icon widget I’m using. However instead of looking like the icons at the bottom of my page (should look exactly the same) there are just black dots and blue squares that show up.

    In my child functions.php file I have placed the following code which works:

    <?php
    /**
     * Register our sidebars and widgetized areas.
     *
     */
    function arphabet_widgets_init() {
    
    	register_sidebar( array(
    		'name' => 'Header-ads',
    		'id' => 'header-ads',
    		'before_widget' => '<div id=hwidget>',
    		'after_widget' => '</div>',
    		'before_title' => '<h2 class="rounded">',
    		'after_title' => '</h2>',
    	) );
    }
    add_action( 'widgets_init', 'arphabet_widgets_init' );
    ?>

    I believe the problem is in the header.php file. I tried first placing:

    <?php
    if ( dynamic_sidebar('header-ads') ) :
    else :
    ?>
    <?php endif; ?>
    
    <?php dynamic_sidebar('header-ads'); ?>

    above the get_search_form line without any results. I also tried replacing and removing the get_search_form without any results.

    Finally I placed the code near the top under the </header> which was the first time something showed up. I’m sure the answer lies here somewhere and would be TRULY GRATEFUL if someone can have a look at my code and help me to find the solution.

    Link to child header.php: http://pastebin.com/wCZKPcpR
    Link to css style sheet: http://pastebin.com/jJYuKFPT

  • The topic ‘[Theme: Twenty eleven} Add Widget Area to Header’ is closed to new replies.