Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Count the number of footer sidebars to enable dynamic classes for the footer
- */
- function twentyelevenchild_footer_sidebar_class() {
- $count = 0;
- if ( is_active_sidebar( 'sidebar-3' ) )
- $count++;
- if ( is_active_sidebar( 'sidebar-4' ) )
- $count++;
- if ( is_active_sidebar( 'sidebar-5' ) )
- $count++;
- if ( is_active_sidebar( 'sidebar-6' ) ) //the fourth new one//
- $count++;
- $class = '';
- switch ( $count ) {
- case '1':
- $class = 'one';
- break;
- case '2':
- $class = 'two';
- break;
- case '3':
- $class = 'three';
- break;
- case '4':
- $class = 'four';
- break;
- }
- if ( $class )
- echo 'class="' . $class . '"';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement