SHARE
TWEET

function

alchymyth Feb 22nd, 2013 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function twentyeleven_child_pagetemplates_body_classes( $wp_classes, $extra ){
  2.      
  3.       $classes = array();
  4.      
  5.       if( is_page_template( 'sidebar-page-left-in-one-column.php' ) ) :
  6.       // correction for the Sidebar Template 'left sidebar on page in one-column layout'
  7.         $classes[] = 'left-sidebar';
  8.         $classes[] = 'two-column';
  9.         $blacklist = array('one-column','content','right-sidebar','singular');
  10.         // Filter the body classes
  11.         foreach( $blacklist as $val ) {
  12.           if (!in_array($val, $wp_classes)) : continue;
  13.           else:
  14.           foreach($wp_classes as $key => $value) {
  15.             if ($value == $val) unset($wp_classes[$key]);
  16.           }
  17.           endif;
  18.         }
  19.       endif;
  20.      
  21.     return array_merge($wp_classes, (array) $extra, $classes );
  22.     }
  23.      
  24. add_filter( 'body_class', 'twentyeleven_child_pagetemplates_body_classes', 20, 2 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top