widgets.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. Sidebar widget area (theme default).
  4. **/
  5. // function luceo_widgets_init() {
  6. // register_sidebar( array(
  7. // 'name' => esc_html__( 'Sidebar', 'luceo' ),
  8. // 'id' => 'sidebar-1',
  9. // 'description' => '',
  10. // 'before_widget' => '<section id="%1$s" class="widget %2$s">',
  11. // 'after_widget' => '</section>',
  12. // 'before_title' => '<h2 class="widget-title">',
  13. // 'after_title' => '</h2>',
  14. // ) );
  15. // }
  16. // add_action( 'widgets_init', 'luceo_widgets_init' );
  17. //Push/Pull sidebar widgets
  18. function push_sidebar_widgets_init()
  19. {
  20. register_sidebar(array(
  21. 'name' => 'Push/Pull Sidebar',
  22. 'description' => __('Widgets displayed at push/pull sidebar.', 'uiu_cse'),
  23. 'id' => 'push_sidebar_widgets',
  24. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  25. 'after_widget' => '</div>',
  26. 'before_title' => '<h3 class="widget-title">',
  27. 'after_title' => '</h3>',
  28. ));
  29. }
  30. add_action('widgets_init', 'push_sidebar_widgets_init');
  31. // Notice sidebar widgets
  32. function notice_widgets_init()
  33. {
  34. register_sidebar(array(
  35. 'name' => 'Notice Sidebar',
  36. 'description' => __('Widgets displayed at Notice page.', 'uiu_cse'),
  37. 'id' => 'notice_widgets',
  38. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  39. 'after_widget' => '</div>',
  40. 'before_title' => '<h3 class="widget-title">',
  41. 'after_title' => '</h3>',
  42. ));
  43. }
  44. add_action('widgets_init', 'notice_widgets_init');
  45. //Blog sidebar widgets
  46. function blog_widgets_init()
  47. {
  48. register_sidebar(array(
  49. 'name' => 'Blog/News Sidebar',
  50. 'description' => __('Widgets displayed at blog/news page.', 'uiu_cse'),
  51. 'id' => 'blog_widgets',
  52. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  53. 'after_widget' => '</div>',
  54. 'before_title' => '<h3 class="widget-title">',
  55. 'after_title' => '</h3>',
  56. ));
  57. }
  58. add_action('widgets_init', 'blog_widgets_init');
  59. //Footer widgets
  60. function footer_widgets_init()
  61. {
  62. register_sidebar(array(
  63. 'name' => 'Footer Widgets #1',
  64. 'description' => __('Widgets displayed at footer.', 'uiu_cse'),
  65. 'id' => 'footer_widgets_1',
  66. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  67. 'after_widget' => '</div>',
  68. 'before_title' => '<h3 class="widget-title">',
  69. 'after_title' => '</h3>',
  70. ));
  71. register_sidebar(array(
  72. 'name' => 'Footer Widgets #2',
  73. 'description' => __('Widgets displayed at footer.', 'uiu_cse'),
  74. 'id' => 'footer_widgets_2',
  75. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  76. 'after_widget' => '</div>',
  77. 'before_title' => '<h3 class="widget-title">',
  78. 'after_title' => '</h3>',
  79. ));
  80. register_sidebar(array(
  81. 'name' => 'Footer Widgets #3',
  82. 'description' => __('Widgets displayed at footer.', 'uiu_cse'),
  83. 'id' => 'footer_widgets_3',
  84. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  85. 'after_widget' => '</div>',
  86. 'before_title' => '<h3 class="widget-title">',
  87. 'after_title' => '</h3>',
  88. ));
  89. register_sidebar(array(
  90. 'name' => 'Footer Widgets #4',
  91. 'description' => __('Widgets displayed at footer.', 'uiu_cse'),
  92. 'id' => 'footer_widgets_4',
  93. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  94. 'after_widget' => '</div>',
  95. 'before_title' => '<h3 class="widget-title">',
  96. 'after_title' => '</h3>',
  97. ));
  98. }
  99. add_action('widgets_init', 'footer_widgets_init');