bp_dtheme_widgets_init

Register widgetised areas, including one sidebar and four widget-ready columns in the footer.

Description

bp_dtheme_widgets_init(); 

To override bp_dtheme_widgets_init() in a child theme, remove the action hook and add your own function tied to the init hook.


Usage

  1. if ( !function_exists( 'bp_dtheme_widgets_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-themes/bp-default/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_dtheme_widgets_init(); 
  7.  

Defined (1)

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

/bp-themes/bp-default/functions.php  
  1. function bp_dtheme_widgets_init() { 
  2.  
  3. // Area 1, located in the sidebar. Empty by default. 
  4. register_sidebar( array( 
  5. 'name' => 'Sidebar',  
  6. 'id' => 'sidebar-1',  
  7. 'description' => __( 'The sidebar widget area', buddypress ),  
  8. 'before_widget' => '<div id="%1$s" class="widget %2$s">',  
  9. 'after_widget' => '</div>',  
  10. 'before_title' => '<h3 class="widgettitle">',  
  11. 'after_title' => '</h3>' 
  12. ) ); 
  13.  
  14. // Area 2, located in the footer. Empty by default. 
  15. register_sidebar( array( 
  16. 'name' => __( 'First Footer Widget Area', buddypress ),  
  17. 'id' => 'first-footer-widget-area',  
  18. 'description' => __( 'The first footer widget area', buddypress ),  
  19. 'before_widget' => '<li id="%1$s" class="widget %2$s">',  
  20. 'after_widget' => '</li>',  
  21. 'before_title' => '<h3 class="widgettitle">',  
  22. 'after_title' => '</h3>',  
  23. ) ); 
  24.  
  25. // Area 3, located in the footer. Empty by default. 
  26. register_sidebar( array( 
  27. 'name' => __( 'Second Footer Widget Area', buddypress ),  
  28. 'id' => 'second-footer-widget-area',  
  29. 'description' => __( 'The second footer widget area', buddypress ),  
  30. 'before_widget' => '<li id="%1$s" class="widget %2$s">',  
  31. 'after_widget' => '</li>',  
  32. 'before_title' => '<h3 class="widgettitle">',  
  33. 'after_title' => '</h3>',  
  34. ) ); 
  35.  
  36. // Area 4, located in the footer. Empty by default. 
  37. register_sidebar( array( 
  38. 'name' => __( 'Third Footer Widget Area', buddypress ),  
  39. 'id' => 'third-footer-widget-area',  
  40. 'description' => __( 'The third footer widget area', buddypress ),  
  41. 'before_widget' => '<li id="%1$s" class="widget %2$s">',  
  42. 'after_widget' => '</li>',  
  43. 'before_title' => '<h3 class="widgettitle">',  
  44. 'after_title' => '</h3>',  
  45. ) ); 
  46.  
  47. // Area 5, located in the footer. Empty by default. 
  48. register_sidebar( array( 
  49. 'name' => __( 'Fourth Footer Widget Area', buddypress ),  
  50. 'id' => 'fourth-footer-widget-area',  
  51. 'description' => __( 'The fourth footer widget area', buddypress ),  
  52. 'before_widget' => '<li id="%1$s" class="widget %2$s">',  
  53. 'after_widget' => '</li>',  
  54. 'before_title' => '<h3 class="widgettitle">',  
  55. 'after_title' => '</h3>',  
  56. ) );