SHARE
TWEET

functions for right sidebar page in one-column

alchymyth Nov 6th, 2012 72 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-right-in-one-column.php' ) ) :
  6.   // correction for the Sidebar Template 'right sidebar on page in one-column layout'
  7.     $classes[] = 'right-sidebar';
  8.     $classes[] = 'two-column';
  9.     $blacklist = array('one-column','content','left-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
 
Top