WordPress.org

Ready to get started?Download WordPress

Forums

Widget in the header? (4 posts)

  1. JustMagicMaria
    Member
    Posted 6 years ago #

    I'm writing my own theme. Is it possible to make a widget-ready HEADER rather than sidebar? In other words, can I call dynamic_sidebar in header.php? I know, I could just try it and see if it works...

    (The reason I'm asking: I'm making a plugin for managing page menus. Page menus can go in the header, footer, sidebars...)

    Maria

  2. Doodlebee
    Member
    Posted 6 years ago #

    can I call dynamic_sidebar in header.php?

    Yes.

  3. bryan868
    Member
    Posted 6 years ago #

    Yes, this is possible. In fact, one could make an entire theme widgetized. Hmmm...

  4. Daiv Mowbray
    Member
    Posted 6 years ago #

    Hey there JustMagicMaria did you ever get this to work?
    I am looking at adding a widget to my header also. Just wondered how to do it, I was trying this: with no luck, I thought I would have a third column in the admin/presentation/widgets page.

    <h2>
        <?php if ( is_home() ) {
        	bloginfo('description'); }
        	else if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Top Sidebar') ) : else :
        	{
        	the_category();
        	} endif;?>
        	</h2>

Topic Closed

This topic has been closed to new replies.

About this Topic