ThemeShaper Forums » Thematic

[closed]

adding a simple widget area at 'thematic_belowheader'

(5 posts)
  • Started 3 years ago by js09
  • Latest reply from js09
  • This topic is not resolved

Tags:

  1. js09
    Member

    I'm not too sure why I'm having trouble finding any answers for this (that work) but i'm sure its common to simply add a widget area somewhere? The basic included widget placements are nice and all, but don't work if you need to lots of skin editing.

    So. I need to add a widget area to 'thematic_belowheader'... orrrr 'thematic_aboveheader', etc. anywhere will work (except the sidebar since its gone)

    Posted 3 years ago #
  2. azoomer
    Member

    this thread might help you (page: 1-2-3)
    http://forums.themeshaper.com/topic/widgets-in-the-header

    Posted 3 years ago #
  3. js09
    Member

    I've tried following that post for hours and have gotten nowhere.

    I can add the code in my childs functions.php but when adding a widget to 'header-aside' it doesn't save. It even shows a broken image icon. I figured it's because that post is over a year old??

    But regardless, the code listed in that post is for a sidebar widget, which doesn't help me at all.

    Posted 3 years ago #
  4. azoomer
    Member

    This is what i have in the functions.php of a page where i added a widget to the header. It works. you can see the flash in the header of this site http://phototrickster.com/

    // This will create your widget area
    function my_widgets_init() {
        register_sidebar(array(
           	'name' => 'Header Aside',
           	'id' => 'header-aside',
           	'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
           	'after_widget' => "\n",
    		'before_title' => "<h3 class=\"widgettitle\">",
    		'after_title' => "</h3>\n",
        ));
    
    }
    add_action( 'init', 'my_widgets_init' );
    
    // og også dette:  adding the widget area to your child theme
    function my_header_widgets() {
    if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside') ) {
        echo '<div id="header-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
        dynamic_sidebar('header-aside');
    	echo '' . "\n" . ''. "\n";
        echo '' . "\n" . '</div><!-- #header-aside .aside -->'. "\n";
        echo "\n" . '</div><!-- #header-box -->'. "\n";
    }
    }
    add_action('thematic_header', 'my_header_widgets', 8);
    
    function remove_branding() {
    		remove_action('thematic_header','thematic_brandingopen',1);
    }
    add_action('init', 'remove_branding');
    
    function my_brandingopen() { ?>
    	<div id="header_box">
        	<div id="branding">
    <?php }
    add_action('thematic_header','my_brandingopen',1);

    Ok i don't know if it helps but I thought i would show you.
    It is Thematic 0.9.6.1, by the way (child theme)

    Posted 3 years ago #
  5. js09
    Member

    i figured it out, the code worked all long. hehe. so if i wanted to add the widget area to 'thematic_belowheader' instead of 'thematic_header' i would replace it? like so:

    // This will create your widget area
    function my_widgets_init() {
    register_sidebar(array(
    'name' => 'Header Aside',
    'id' => 'header-aside',
    'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
    'after_widget' => "\n",
    'before_title' => "<h3 class=\"widgettitle\">",
    'after_title' => "</h3>\n",
    ));

    }
    add_action( 'init', 'my_widgets_init' );

    // og også dette: adding the widget area to your child theme
    function my_header_widgets() {
    if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside') ) {
    echo '<div id="header-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
    dynamic_sidebar('header-aside');
    echo '' . "\n" . ''. "\n";
    echo '' . "\n" . '</div><!-- #header-aside .aside -->'. "\n";
    echo "\n" . '</div><!-- #header-box -->'. "\n";
    }
    }
    add_action('thematic_belowheader', 'my_header_widgets', 8);

    function remove_branding() {
    remove_action('thematic_belowheader','thematic_brandingopen',1);
    }
    add_action('init', 'remove_branding');

    function my_brandingopen() { ?>
    <div id="header_box">
    <div id="branding">
    <?php }
    add_action('thematic_belowheader','my_brandingopen',1);

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.