Displaying our New Widget Container on WordPress

Before you tackle this article, it is very important to check out this link: Add a Widget Container to Twenty Ten Theme.

After you have created a new widget container in the Twenty Ten theme (or whatever theme you are using), then you can continue here and this will enable your widget to display on every single page of your website.  Similar to the way that it does it on this blog.

Browse to Admin -> Appearance -> Editor and open header.php (on the right hand side of your admin page).

Now at this stage, I would suggest just getting comfortable with everything here, but our content is going to go just before the line seen below:

<div id="header">

Here is the code Snippet to paste in:

<?php if (!dynamic_sidebar("Header Top Widget") ) : ?>
Default header widget stuff here…
<?php endif; ?>

At this point, if you haven’t configured your widget from the previous post, then head over there now, or your blog will have the text “Default header widget stuff here…” displaying on every page of your application. Once more, you configure this widget by browsing to Admin -> Appearance -> Widgets, where after successful completion of this tutorial, you should have a Widget Container named “Header Top Widget”.

Tags: , , , ,

About the Author: JeffAncel
A passionate web developer in St. Louis. Living on the edge with Rails, HTML5, CSS3 and any interesting libraries around. I love to spend time with the family, cook, develop web applications and play with our dragons. When I have nothing else to do, I socialize via twitter (@jancel) and facebook.

2 Responses to Displaying our New Widget Container on WordPress

Leave a reply

© 2012 - Jeff Ancel
Wordpress Themes
Scroll to Top