ThemeShaper Forums » Thematic


Alternating Sidebars, depending on home/pages ?

(2 posts)
  • Started 10 years ago by maren.m
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. maren.m

    Hi there,

    I'm a bit of a beginner with PHP, so this may be a simple question, but I've been struggling and struggling..

    Basically, I am trying to display the Primary Aside on the Index and the Secondary Aside on the Pages.

    The furthest I've gotten is just Primary on Index, but then both Primary and Secondary on Pages (I want ONLY Secondary on Pages).

    Also: I am interested in using the Secondary Aside on the Pages in order to display said pages' children. Any thoughts on that?


    Posted 10 years ago #
  2. you need to do 2 things.

    1. point the widget area to a new function

    function change_widgetized_area($content) {
    	$content['Primary Aside']['args']['function']='child_1st_subsidiary_aside';
    	$content['Secondary Aside']['args']['function']='child_2nd_subsidiary_aside';
    	return $content;
    add_filter('thematic_widgetized_areas', 'change_widgetized_area');

    then define those functions. they will look almost identical to the originals (which are found in widget-extensions.php of the thematic/library/extensions folder) except with a little added conditional logic

    function child_1st_subsidiary_aside {
    	if (is_active_sidebar('primary-aside') AND is_home() ) {
    		echo thematic_before_widget_area('primary-aside');
    		echo thematic_after_widget_area('primary-aside');
    function child_2nd_subsidiary_aside [
    	if (is_active_sidebar('secondary-aside') AND !(is_home() ) {
    		echo thematic_before_widget_area('secondary-aside');
    		echo thematic_after_widget_area('secondary-aside');

    totally untested. but in theory it should make the primary aside show up on the blog index and the 2nd aside show up everywhere else. you can modify the conditional logic until you get it the way you want.

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.