twentyeleven_widgets_init

Register sidebars and widgetized areas.

Description

twentyeleven_widgets_init(); 

Also register the default Epherma widget.


Usage

  1. if ( !function_exists( 'twentyeleven_widgets_init' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyeleven_widgets_init(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function twentyeleven_widgets_init() { 
  2.  
  3. register_widget( 'Twenty_Eleven_Ephemera_Widget' ); 
  4.  
  5. register_sidebar( array( 
  6. 'name' => __( 'Main Sidebar', 'twentyeleven' ),  
  7. 'id' => 'sidebar-1',  
  8. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',  
  9. 'after_widget' => "</aside>",  
  10. 'before_title' => '<h3 class="widget-title">',  
  11. 'after_title' => '</h3>',  
  12. ) ); 
  13.  
  14. register_sidebar( array( 
  15. 'name' => __( 'Showcase Sidebar', 'twentyeleven' ),  
  16. 'id' => 'sidebar-2',  
  17. 'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),  
  18. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',  
  19. 'after_widget' => "</aside>",  
  20. 'before_title' => '<h3 class="widget-title">',  
  21. 'after_title' => '</h3>',  
  22. ) ); 
  23.  
  24. register_sidebar( array( 
  25. 'name' => __( 'Footer Area One', 'twentyeleven' ),  
  26. 'id' => 'sidebar-3',  
  27. 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),  
  28. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',  
  29. 'after_widget' => "</aside>",  
  30. 'before_title' => '<h3 class="widget-title">',  
  31. 'after_title' => '</h3>',  
  32. ) ); 
  33.  
  34. register_sidebar( array( 
  35. 'name' => __( 'Footer Area Two', 'twentyeleven' ),  
  36. 'id' => 'sidebar-4',  
  37. 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),  
  38. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',  
  39. 'after_widget' => "</aside>",  
  40. 'before_title' => '<h3 class="widget-title">',  
  41. 'after_title' => '</h3>',  
  42. ) ); 
  43.  
  44. register_sidebar( array( 
  45. 'name' => __( 'Footer Area Three', 'twentyeleven' ),  
  46. 'id' => 'sidebar-5',  
  47. 'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),  
  48. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',  
  49. 'after_widget' => "</aside>",  
  50. 'before_title' => '<h3 class="widget-title">',  
  51. 'after_title' => '</h3>',  
  52. ) );