Advertisement
daymobrew

Add widget area to Genesis page template

May 13th, 2024
751
0
169 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | Source Code | 0 0
  1. <?php
  2. // In functions.php (or a functional plugin)
  3. add_action( 'genesis_setup', 'dcwd_register_genesis_widget_area' );
  4. function dcwd_register_genesis_widget_area() {
  5.     // Register widget areas.
  6.     genesis_register_sidebar(
  7.     [
  8.         'id'          => 'avijit-footer',
  9.         'name'        => 'Avijit Footer',
  10.         'description' => 'This is the widget area for Avijit.',
  11.     ]
  12.     );
  13. }
  14.  
  15.  
  16. // In the 'forum' page template
  17. // Customize site footer
  18. add_action( 'genesis_footer', 'leaguewp_custom_footer' );
  19. function leaguewp_custom_footer() { ?>
  20. <div class="site-footer"><div class="wrap"><p></p>
  21. <?php
  22. // This is the new code.
  23. genesis_widget_area(
  24.         'avijit-footer',
  25.         [
  26.             'before' => '<div class="avijit-footer widget-area">',
  27.             'after'  => '</div>',
  28.         ]
  29.     );
  30.  
  31. ?>
  32. </div></div>
  33. <?php
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement