ThemeShaper Forums » Thematic

[closed]

Add top widget area to multi-post/archive pages?

(1 post)
  • Started 9 years ago by Seijun
  • This topic is not resolved

Tags:

  1. I am trying to add a top-widget area to mutli-post and archive (non-page pages). I see there is a top widget area but only for the index and static pages.

    I found this code in another post to add a new widget area to the header div.

    // 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' => "",
    		'before_title' => "<h3 class=\"widgettitle\">",
    		'after_title' => "</h3>\n",
        ));
    
    }
    add_action( 'init', 'my_widgets_init' );
    
    // 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" . '</div><!-- #header-aside .aside -->'. "\n";
    }
    }
    add_action('thematic_header', 'my_header_widgets', 8);

    I changed "thematic_header" to "thematic_belowheader" to put it below the header instead of in it. It seems to be working. Did I do this "properly"?

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.