Declare Multiple Widgetized Areas


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.