• Resolved Argentum

    (@argentum)


    I used a snippet in my functions.php that worked with an old version of Customizr. I rendered an text widget after the header on all pages. After upgrading to the latest version, I see in the code inspector, the widget is rendered at the top of the page behind the menu. Any ideas what I should do to make it display before the slider? I guess the Customizr code has changed.

    
    // Adds a widget area.
    if (function_exists('register_sidebar')) {
        register_sidebar(array(
        'name' => 'Extra Header Widget Area',
        'id' => 'extra-widget-area',
        'description' => 'Extra widget area after the header',
        'before_widget' => '<div class="widget my-extra-widget">',
        'after_widget' => '</div>',
        'before_title' => '<h2>',
        'after_title' => '</h2>'
        ));
    }
    
    // Place the widget area after the header
    add_action ('__after_header', 'add_my_widget_area', 0);
    function add_my_widget_area() {
        if (function_exists('dynamic_sidebar')) {
        dynamic_sidebar('Extra Header Widget Area');
        }
    }
    
    • This topic was modified 7 years, 5 months ago by Argentum.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,
    cannot reproduce the issue. That ‘__after_header’ hook is still in the theme code.

    Can you share a link to your website?

    Did you enable the sticky header?

    Thread Starter Argentum

    (@argentum)

    Aye, that was it. When I disabled sticky header the text widget popped up. Well, you can’t have everything I guess. I tried the other hooks but __after_header is the one that works best so I’ll skip the sticky header.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Text widget after header’ is closed to new replies.