ThemeShaper Forums » Thematic

[closed]

Widgets in below_header

(7 posts)
  • Started 13 years ago by Seijun
  • Latest reply from gino
  • This topic is resolved
  1. I got this code from another topic for adding a new widget area.

    function add_header_aside($content) {
    	$content['Header Aside'] = array(
    		'args' => array (
    			'name' => 'Header Aside',
    			'id' => 'header-aside',
    			'before_widget' => thematic_before_widget(),
    			'after_widget' => thematic_after_widget(),
    			'before_title' => thematic_before_title(),
    			'after_title' => thematic_after_title(),
    		),
    		'action_hook'	=> 'thematic_header',
    		'function'		=> 'thematic_header_aside',
    		'priority'		=> 8,
    	);
    	return $content;
    }
    add_filter('thematic_widgetized_areas', 'add_header_aside');
    
    // And this is our new function that displays the widgetized area
    function thematic_header_aside() {
    	if (is_sidebar_active('header-aside')) {
    		echo thematic_before_widget_area('header-aside');
    		dynamic_sidebar('header-aside');
    		echo thematic_after_widget_area('header-aside');
    	}
    }

    How would I modify this to add the widget to the below_header area?
    I was just going to change "action_hook' => 'thematic_header" to "action_hook' => 'thematic_belowheader" but I'm not sure if that is correct.

    Posted 13 years ago #
  2. Jamie Mitchell
    Member

    do like you said, thematic_belowheader will put it exactly there.

    J

    Posted 13 years ago #
  3. gino
    Member

    Hey great topic there

    Does anyone know how to let this apply JUST on the home page?

    Thanks!

    Gino

    Posted 12 years ago #
  4. you just adjust the conditionals

    // And this is our new function that displays the widgetized area
    function thematic_header_aside() {
    	if (is_sidebar_active('header-aside') && is_home()) {
    		echo thematic_before_widget_area('header-aside');
    		dynamic_sidebar('header-aside');
    		echo thematic_after_widget_area('header-aside');
    	}
    }
    Posted 12 years ago #
  5. gino
    Member

    brilliant!

    thanks helga- i really need to get better with php!

    Posted 12 years ago #
  6. gino
    Member

    It works fine, but what I am actually trying to do is to have the same widgets (just text widgets at the mo)
    to move from primary_aside to header_aside on the home page and then go back to the right for the rest of the site..

    Any ideas?

    Posted 12 years ago #
  7. gino
    Member

    Hey Helga

    Making frogress at last!

    But, what if you would have to adjust the conditionals to effect a specifice page like, for example, page-37.php or post=37

    Thanks a squillion

    G

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.