Why won’t my custom widget area show?
-
Scratching my head a bit here…
I did what I always do: created a custom widget area by adding the following code to functions.php:
register_sidebar( array( 'name' => __( 'Header Right' ), 'id' => 'header-right', 'description' => __( 'Widgets for the right side of the header.' ), 'before_widget' => '<div id="%1$s" class="%2$s">', 'after_widget' => '</div>', ) );
The widget area is showing correctly in the admin and I added two widgets, a plain text one and a search bar.
Now in the header template I am calling the widget area thus:
<div class="st-header-right"> <?php if ( is_active_sidebar( 'header-right' ) ) : ?> <?php dynamic_sidebar( 'header-right' ); ?> <?php endif; ?> </div>
It should work, right? I doesn’t. The div is loaded, but the content is empty.
What am I missing here??
- This topic was modified 3 years, 8 months ago by .
- This topic was modified 3 years, 8 months ago by .
The page I need help with: [log in to see the link]
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Why won’t my custom widget area show?’ is closed to new replies.