Support

MackOne - Widget in header (5 posts)

Languages

de | fr | es | 日本語

About This Topic

Tags

  1. rss PureLoneWolf

    junior member


    rss Posted 2 years ago
    #

    Hi there

    I am using the MackOne theme (slightly altered) on a site I am doing for a friend (http://arrior.wolflan.com). I wondered if there was a simple way to add a single widget to the themes header in place of the date script?

    Is this possible? If so, would you be willing to point me in the right direction as to how to go about it? I am using an Ajax page loader to keep the header from refreshing and I have a fantastic Flash MP3 widget that I would like to put on there so that navigating around the site doesn't stop the music from playing (if the user has decided to play some).

    I am quite new to modifying Wordpress and have never done my own theme before..but I think you are defining a 3rd sidebar in functions.php that isn't displayed...but I can't figure out how to get this put into the header.

    I would be very greatful for any help you would be willing to provide.

    Many thanks in advance

  2. rss milo

    moderator


    rss Posted 2 years ago
    #

    Add new widget for header:

    use this in theme functions:
    // sidebar stuff
    register_sidebars( 1,
    array(
    'name' => 'Head column',
    'id' => 'head-column',
    'description' => __('The head-column widget area, most often used for placing your custom code.'),
    'before_widget' => '<div id="%1$s" class="widget %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h3>'
    )
    );

    then this in the header area where you want the widget to appear:
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar('head-column') ) : ?>

    <?php endif; ?>

  3. rss PureLoneWolf

    junior member


    rss Posted 2 years ago
    #

    Ok thanks.

    I can't seem to get the positioning to work at the moment, so I have put it in the footer for now.

    What code would I use in the MackOne header.php to have the widget appear in the exact same position as the date is currently?

    When I replaced the date code, it put the widget floating halfway down the page...

    Many thanks again for your help

  4. rss milo

    moderator


    rss Posted 2 years ago
    #

    You have to place the widget inside the date div
    starts with
    <div id="dateToday">

  5. rss PureLoneWolf

    junior member


    rss Posted 2 years ago
    #

    I thought I had done that...but it is entirely possible that I just think I did...

    I'll give it a go...thanks for all your help

Reply

You must log in to post.

Design by milo

Milo designs web sites that strike the perfect balance between professional high-class graphics, functionality, usability, user experience, and high performance.