catchresponsive_widgets_init

Register widgetized area and update sidebar with default widgets.

Description

catchresponsive_widgets_init(); 

Usage

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

Defined (1)

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

/inc/catchresponsive-widgets.php  
  1. function catchresponsive_widgets_init() { 
  2. //Primary Sidebar 
  3. register_sidebar( array( 
  4. 'name' => __( 'Primary Sidebar', 'catch-responsive' ),  
  5. 'id' => 'primary-sidebar',  
  6. 'before_widget' => '<section id="%1$s" class="widget %2$s"><div class="widget-wrap">',  
  7. 'after_widget' => '</div><!-- .widget-wrap --></section><!-- #widget-default-search -->',  
  8. 'before_title' => '<h4 class="widget-title">',  
  9. 'after_title' => '</h4>',  
  10. 'description' => __( 'This is the primary sidebar if you are using a two or three column site layout option.', 'catch-responsive' ),  
  11. ) ); 
  12.  
  13. $footer_sidebar_number = 3; //Number of footer sidebars 
  14.  
  15. for( $i=1; $i <= $footer_sidebar_number; $i++ ) { 
  16. register_sidebar( array( 
  17. 'name' => sprintf( __( 'Footer Area %d', 'catch-responsive' ), $i ),  
  18. 'id' => sprintf( 'footer-%d', $i ),  
  19. 'before_widget' => '<section id="%1$s" class="widget %2$s"><div class="widget-wrap">',  
  20. 'after_widget' => '</div><!-- .widget-wrap --></section><!-- #widget-default-search -->',  
  21. 'before_title' => '<h4 class="widget-title">',  
  22. 'after_title' => '</h4>',  
  23. 'description' => sprintf( __( 'Footer %d widget area.', 'catch-responsive' ), $i ),  
  24. ) );