Want more features on Pastebin? Sign Up, it's FREE!
Guest

twenty eleven child functions addendum for sidebar page

By: alchymyth on Aug 29th, 2011  |  syntax: PHP  |  size: 0.43 KB  |  views: 732  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data