Support » Plugin: WP Custom Widget area » Insert the widget in headers

  • I need to inset the widget into the header but i am having issues. I have gone through other tickets and i found this:

    <div class=”header-right-widget”><?php dynamic_sidebar( ‘header-widget’ ); ?></div>

    I added it in but not luck can you please help? Do you need my complete header.php code to know where to correctly place? I may be putting incorrectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • My problem is similar, not sure where to place the code. Please help!

    Hey Cory, check your functions.php and make sure you have the correct widget ID name.

    The PHP Code should look like this:

    function northwest_fishing_news_init () {
    register_sidebar ( array (
    ‘name’ => ‘Header Widget’,
    ‘id’ => ‘header-widget’’,
    ‘before_widget’ => ‘<div class=”header-right-widget”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,


    add_action ( ‘widgets_init’,’northwest_fishing_news_init’);

    When you insert into header the php code you enter into your header.php file should look like this. <?php dynamic_sidebar( ‘header-widget’ ); ?>

    Hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Insert the widget in headers’ is closed to new replies.