SHARE
TWEET

twenty eleven child functions addendum for sidebar page

alchymyth Aug 29th, 2011 749 Never
  1. add_filter('body_class', 'adjust_body_class', 20, 2);  
  2. function adjust_body_class($wp_classes, $extra_classes) {
  3.  
  4. if( is_page_template('sidebar-preinsulated.php') ) :
  5. // Filter the body classes    
  6.        
  7.           foreach($wp_classes as $key => $value) {
  8.           if ($value == 'singular') unset($wp_classes[$key]);
  9.           }
  10.      
  11. endif;
  12. // Add the extra classes back untouched
  13. return array_merge($wp_classes, (array) $extra_classes );
  14. }
RAW Paste Data
Top