ThemeShaper Forums » Thematic

[closed]

How to include widget area in category pages?

(6 posts)
  • Started 5 years ago by awarner20
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. I am trying to add a text widget and use widget logic to specify is_category('62') so it only shows on that category archive page. I don't want this in the Primary Aside or Secondary Aside areas. Rather, I am trying to get this inserted into a category archive page like Index Top, Single Top, Page Top, etc.

    I cannot get it to work. Is this possible?

    (this was also asked by another user 4 months ago)
    http://forums.themeshaper.com/topic/widgetize-archive-page#post-1972

    Posted 5 years ago #
  2. Anyone have any advice on this one?

    Posted 5 years ago #
  3. amygail
    Member

    Follow this thread (or just keep your eyes out for an announcement)

    http://forums.themeshaper.com/topic/how-to-add-widget-areas

    Posted 5 years ago #
  4. Ah...cool:) By the way, you said keep you're eyes out...I'll do that with at least one;)

    Posted 5 years ago #
  5. I'm interested in a simple way to add a widget to go above the loop in the Category and Archive templates. Still looking.

    Posted 3 years ago #
  6. @jcollier

    here is what i do to define a 4th subsidiary widget area

    // Defining functions for new widget areas 
    
    function child_4th_subsidiary_aside() {
    	if (is_sidebar_active('4th-subsidiary-aside')) {
    		echo '<div id="fourth" class="aside sub-aside">'. "\n" . '<ul class="xoxo">' . "\n";
    		dynamic_sidebar('4th-subsidiary-aside');
    		echo '' . "\n" . '</div><!-- #fourth .sub-aside .aside -->'. "\n";
    	}
    }
    /* Defining Widget Areas */
    
    function remove_widget_areas($content) {
    
    	$content['4th Subsidiary Aside'] = array(
    			'admin_menu_order' => 700,
    			'args' => array (
    				'name' => '4th Subsidiary Aside',
    				'id' => '4th-subsidiary-aside',
                    'description' => __('The 4th widget area in the footer.', 'thematic'),
    				'before_widget' => thematic_before_widget(),
    				'after_widget' => thematic_after_widget(),
    				'before_title' => thematic_before_title(),
    				'after_title' => thematic_after_title(),
    				),
    			'action_hook'	=> 'widget_area_subsidiaries',
    			'function'		=> 'child_4th_subsidiary_aside',
    			'priority'		=> 90,
    		);	
    
    	return $content;
    }
    add_filter('thematic_widgetized_areas', 'remove_widget_areas');

    so to real quickly try to adapt it for you (w/o testing so ymmv)

    // Defining functions for new widget areas 
    
    function child_archive_aside() {
    	if (is_category() || is_archive() && is_sidebar_active('archive-aside')) {
    		echo '<div id="archive-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
    		dynamic_sidebar('archive-aside');
    		echo '' . "\n" . '</div><!-- #archive-aside .aside -->'. "\n";
    	}
    }
    /* Defining Widget Areas */
    
    function remove_widget_areas($content) {
    
    	$content['Archive Aside'] = array(
    			'admin_menu_order' => 700,
    			'args' => array (
    				'name' => 'Archive Aside',
    				'id' => 'archive-aside',
                    'description' => __('The 4th widget area in the footer.', 'thematic'),
    				'before_widget' => thematic_before_widget(),
    				'after_widget' => thematic_after_widget(),
    				'before_title' => thematic_before_title(),
    				'after_title' => thematic_after_title(),
    				),
    			'action_hook'	=> 'thematic_abovepost', //tells thematic where to put the function
    			'function'		=> 'child_archive_aside', //points to the function above
    			'priority'		=> 90,
    		);	
    
    	return $content;
    }
    add_filter('thematic_widgetized_areas', 'remove_widget_areas');

    hopefully it will atleast put you on the right path.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.