Posted By

almendro on 06/13/13


Tagged

wordpress wp twentytwelve sidebar-footer


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

almendro


WP twentytwelve theme width sidebar footer again. Part 2: SIDEBAR-FOOTER.PHP


 / Published in: HTML
 

How to put sidebars footer on twenty twelve theme again. Part 2: Create the file sidebar-footer.php into the theme directory

  1. <?php
  2. /**
  3. * The Footer widget areas.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Eleven
  7. * @since Twenty Eleven 1.0
  8.  
  9. Ported to Twenty_Twelve by Martin Ochoa 2013-06-12
  10. */
  11. ?>
  12.  
  13. <?php
  14. /* The footer widget area is triggered if any of the areas
  15. * have widgets. So let's check that first.
  16. *
  17. * If none of the sidebars have widgets, then let's bail early.
  18. */
  19. if ( ! is_active_sidebar( 'sidebar-4' )
  20. && ! is_active_sidebar( 'sidebar-5' )
  21. && ! is_active_sidebar( 'sidebar-6' )
  22. )
  23. return;
  24. // If we get this far, we have widgets. Let do this.
  25. ?>
  26. <div id="supplementary" <?php twentytwelve_footer_sidebar_class(); ?>>
  27. <?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
  28. <div id="first" class="widget-area" role="complementary">
  29. <?php dynamic_sidebar( 'sidebar-4' ); ?>
  30. </div><!-- #first .widget-area -->
  31. <?php endif; ?>
  32.  
  33. <?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
  34. <div id="second" class="widget-area" role="complementary">
  35. <?php dynamic_sidebar( 'sidebar-5' ); ?>
  36. </div><!-- #second .widget-area -->
  37. <?php endif; ?>
  38.  
  39. <?php if ( is_active_sidebar( 'sidebar-6' ) ) : ?>
  40. <div id="third" class="widget-area" role="complementary">
  41. <?php dynamic_sidebar( 'sidebar-6' ); ?>
  42. </div><!-- #third .widget-area -->
  43. <?php endif; ?>
  44. </div><!-- #supplementary -->

Report this snippet  

You need to login to post a comment.