Title: Body class causing hover effect problems
Last modified: August 31, 2016

---

# Body class causing hover effect problems

 *  Resolved [mintmoss](https://wordpress.org/support/users/mintmoss/)
 * (@mintmoss)
 * [10 years ago](https://wordpress.org/support/topic/body-class-causing-hover-effect-problems/)
 * Hello! I’m using a Hitchcock child theme, and just set up a new page and a custom
   php file to go with it. It is mostly working correctly. However…
 * I’m having a problem with a hover effect. There’s an opacity effect that is supposed
   to happen when you rollover the image, but it happens anytime you rollover the
   body area.
 * Here’s the page I’m having a problem with: [http://mintandmoss.com/main](http://mintandmoss.com/main)
   
   Here’s a page with an example of how the hover should work: [http://mintandmoss.com/blog](http://mintandmoss.com/blog)
 * In reading through the CSS, it looks like there’s a class called .post that is
   responsible for this hover effect. Then I also noticed that the word “post” is
   part of the body class for this page. Out of curiosity, I hardcoded the body 
   class into the php page without the word “post” and the hover effect started 
   working correctly. Coincidence? I don’t know enough to know.
 * Any ideas for how to get this hover effect to start working correctly? I’m thinking
   that I could update the function php file to give this specific page a different
   body class…but I don’t know how to do that. Is there a better way? Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [mintmoss](https://wordpress.org/support/users/mintmoss/)
 * (@mintmoss)
 * [10 years ago](https://wordpress.org/support/topic/body-class-causing-hover-effect-problems/#post-7442643)
 * I think I’ve got this solved. If this might help you, I added a class filter 
   to my function.php file:
 *     ```
       add_filter('body_class', 'remove_a_body_class', 20, 2);
       function remove_a_body_class($wp_classes) {
       if( is_page('Main') ) :
             foreach($wp_classes as $key => $value) {
             if ($value == 'post single') unset($wp_classes[$key]);
             }
       endif;
       return $wp_classes;
       }
       ```
   
 * There’s probably an easier way to just not set the class in the first place, 
   but I couldn’t figure it out. 🙂
 * This is where I found the solution: [https://wordpress.org/support/topic/how-to-delete-page-class-from-body-on-one-page-template?replies=5](https://wordpress.org/support/topic/how-to-delete-page-class-from-body-on-one-page-template?replies=5)

Viewing 1 replies (of 1 total)

The topic ‘Body class causing hover effect problems’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/hitchcock/2.2.1/screenshot.jpg)
 * Hitchcock
 * [Support Threads](https://wordpress.org/support/theme/hitchcock/)
 * [Active Topics](https://wordpress.org/support/theme/hitchcock/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/hitchcock/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/hitchcock/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [mintmoss](https://wordpress.org/support/users/mintmoss/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/body-class-causing-hover-effect-problems/#post-7442643)
 * Status: resolved