Thesis: widgetized footer


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /*--------------------------------------------------*/
  2. /* register sidebars for widgetized footer */
  3. /*--------------------------------------------------*/
  4.  
  5. if (function_exists('register_sidebar')) {
  6. $sidebars = array(1, 2, 3);
  7. foreach($sidebars as $number) {
  8. register_sidebar(array(
  9. 'name' => 'Footer ' . $number,
  10. 'id' => 'footer-' . $number,
  11. 'before_widget' => '',
  12. 'after_widget' => '',
  13. 'before_title' => '<h3>',
  14. 'after_title' => '</h3>'
  15. ));
  16. }
  17. }
  18.  
  19. /*--------------------------------------------------*/
  20. /* set up footer widgets */
  21. /*--------------------------------------------------*/
  22.  
  23. function widgetized_footer() {
  24. ?>
  25. <div id="footer_setup">
  26. <div class="footer_items">
  27. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 1') ) : ?>
  28. <?php endif; ?>
  29. </div>
  30. <div class="footer_items">
  31. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 2') ) : ?>
  32. <?php endif; ?>
  33. </div>
  34. <div class="footer_items_wide">
  35. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer 3') ) : ?>
  36. <?php endif; ?>
  37. </div>
  38. </div>
  39. <?php
  40. }
  41. add_action('thesis_hook_footer','widgetized_footer');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.