Posted By

gd6d on 03/19/10


Tagged

wordpress widget area


Versions (?)

Declare Multiple Widgetized Areas


 / Published in: PHP
 

URL: http://digwp.com/2010/03/declare-multiple-widgetized-areas/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+DiggingIntoWordpress+%28Digging+Into+WordPress%29

  1. if ( function_exists('register_sidebar') ) {
  2.  
  3. $allWidgetizedAreas = array("Homepage Left", "Homepage Right", "Sidebar One", "Movies", "Admin");
  4.  
  5. foreach ($allWidgetizedAreas as $WidgetAreaName) {
  6.  
  7. register_sidebar(array(
  8. 'name'=> $WidgetAreaName,
  9. 'before_widget' => '<div id="%1$s" class="widget %2$s left half">',
  10. 'after_widget' => '</div>',
  11. 'before_title' => '<h3 class="widgettitle">',
  12. 'after_title' => '</h3>',
  13. ));
  14.  
  15. }
  16.  
  17. }

Report this snippet  

You need to login to post a comment.