daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Aug 19th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Remove Wordpress Body Classes
  2. add_filter('body_class','my_class_names');
  3. function my_class_names($classes) {
  4.     return array();
  5. }
  6.    
  7. add_filter('body_class','my_class_names');
  8. function my_class_names($classes) {
  9.     global $wp_query;
  10.  
  11.     $arr = array();
  12.  
  13.     if(is_page()) {
  14.     $page_id = $wp_query->get_queried_object_id();
  15.     $arr[] = 'page-id-' . $page_id;
  16.     }
  17.  
  18.     if(is_single()) {
  19.     $post_id = $wp_query->get_queried_object_id();
  20.     $arr[] = 'postid-' . $post_id;
  21.     }
  22.  
  23.     return $arr;
  24. }
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