View Single Post
Old 11-07-2013, 10:44 AM  
SlamDesigns
Confirmed User
 
Join Date: Jul 2005
Posts: 2,339
Quote:
Originally Posted by Fetish Gimp View Post
The "register_sidebar" function creates a widget AREA. Once you've created a widget AREA then you can drop widgets onto it.

So what you need to do is to create the two different widget areas you need by adding this to your functions file (you could also use register_sidebars() but it's a bit easier to read them when they're separate):

Code:
/* top categories */
if ( function_exists('register_sidebar') ) { 

    register_sidebar( array( 
    
        'id' => 'top-featured-categories',

        'name' => 'Top Featured Categories', 

        'before_widget' => '<div class="widget-container top-featured-categories"><div class="widget-inner">', 

        'after_widget' => '</div></div>', 

        'before_title' => '<h4 class="widget-header">', 

        'after_title' => '</h4>', 

    ));
    
 }
 /* top categories */
 
 
 
 /* regional categories */
 if ( function_exists('register_sidebar') ) { 
 
     register_sidebar( array( 
     	
     	 'id' => 'regional-categories'
 
         'name' => 'Regional Categories', 
 
         'before_widget' => '<div class="widget-container regional-categories"><div class="widget-inner">', 
 
         'after_widget' => '</div></div>', 
 
         'before_title' => '<h4 class="widget-header">', 
 
         'after_title' => '</h4>', 
 
     ));
     
  }
 /* regional categories */
And then you can add them wherever you want on your theme adding this to the template:

Code:
/* show top featured categories widget */
 if( function_exists( 'dynamic_sidebar' ) ) {
 
 dynamic_sidebar( 'top-featured-categories' );
 
 }
/* show top featured categories widget */
 
 
 /* show regional categories widget */
  if( function_exists( 'dynamic_sidebar' ) ) {
  
  dynamic_sidebar( 'regional-categories' );
  
  }
 /* show regional categories widget */
And now you can use CSS to style the two separate widget areas by styling .top-featured-categories and .regional-categories
Thanks Fetish Gimp. I think I can probably do that with the featured categories because they can be separate, but the regional categories are mixed in with other content, so (I don't think) that will work, will it? The basic layout looks something like this....

SlamDesigns is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote