How to Remove or Customize the Header Image Hover Effect in Twenty Sixteen
Content
A common customization request for the Twenty Sixteen theme involves the header image's interactive hover effect. Many users find that when their cursor passes over the header, the image lightens or a "ghostly" alternate version appears. This article explains why this happens and provides clear solutions to either remove or customize this behavior.
Why Does the Header Image Change on Hover?
The hover effect is a deliberate design feature implemented by the Twenty Sixteen team. It's controlled by CSS that applies an opacity change to the header image when a user hovers their mouse over it. This is intended to provide visual feedback, but it may not align with every site's design goals.
How to Remove the Hover Effect with CSS
The most effective and upgrade-safe method to remove this effect is by adding a small amount of CSS to your site. This will completely disable the hover behavior, leaving the header image looking consistent at all times.
Option 1: Using the Customizer (Recommended)
- Navigate to your WordPress Dashboard.
- Go to Appearance → Customize.
- Click on Additional CSS.
- Paste the following code snippet into the CSS editor:
.site-header .header-image:before { display: none !important; } .site-header .header-image:hover { opacity: 1 !important; } - Click Publish to save your changes.
Option 2: Using a Child Theme
If you are already using a child theme, you can add the same CSS code to your child theme's style.css file. This is the best practice for making permanent customizations.
Alternative Solution: Editing the Header Template
For advanced users who have moved the header structure and need more control, another method involves modifying the theme's template file. However, this approach requires using a child theme to prevent your changes from being overwritten during a theme update.
- In your child theme, copy the parent theme's
header.phpfile. - Locate the line containing
header_image();. - You will find the header image is wrapped in an anchor tag (
<a>) that links to the homepage. To remove the hover effect by removing the link itself, you can delete the<a>tags, leaving only the<img>tag. Note: This will also make the header image non-clickable.
Important: Directly editing theme files is not recommended for beginners, as incorrect changes can break your site. Always use a child theme and create a backup first.
Conclusion
Whether you want to remove the hover effect for a cleaner look or simply customize it to better suit your brand, the CSS method provided is the safest and most effective solution. By using the Additional CSS option in the Customizer, you can achieve the desired result without affecting your theme's core files, ensuring your site remains stable and update-proof.
Related Support Threads Support
-
how scale background image to page content?https://wordpress.org/support/topic/how-scale-background-image-to-page-content/
-
I can’t to change highlighted imagehttps://wordpress.org/support/topic/i-cant-to-change-highlighted-image/
-
Minimize size (height) of headerhttps://wordpress.org/support/topic/minimize-size-height-of-header/
-
Post Navigation with Background Imagehttps://wordpress.org/support/topic/post-navigation-with-background-image/
-
Modify banner position and size of Twenty-Sixteen Themehttps://wordpress.org/support/topic/modify-banner-position-and-size-of-twenty-sixteen-theme/
-
Header image smallerhttps://wordpress.org/support/topic/header-image-smaller-3/
-
Giving header and footer same widht as pageshttps://wordpress.org/support/topic/giving-header-and-footer-same-widht-as-pages/
-
Editing background picturehttps://wordpress.org/support/topic/editing-background-picture/
-
Twenty Sixteen and Elementor’s backgroud no repeathttps://wordpress.org/support/topic/twenty-sixteen-and-elementors-backgroud-no-repeat/
-
Twenty Sixteen no-click header imagehttps://wordpress.org/support/topic/twenty-sixteen-no-click-header-image-1/
-
Remove Sticky Headerhttps://wordpress.org/support/topic/remove-sticky-header-4/
-
header image with site titlehttps://wordpress.org/support/topic/header-image-with-site-title/
-
How to make the header stickyhttps://wordpress.org/support/topic/how-to-make-the-header-sticky-1/
-
Always float full header imagehttps://wordpress.org/support/topic/always-float-full-header-image/
-
Full Header Image (Twenty Sixteen)https://wordpress.org/support/topic/full-header-image-twenty-sixteen/
-
Smaller Headerhttps://wordpress.org/support/topic/smaller-header-3/
-
Modifying the header with a child themehttps://wordpress.org/support/topic/modifying-the-header-with-a-child-theme/
-
Extending background of header image to viewport edgehttps://wordpress.org/support/topic/extending-background-of-header-image-to-viewport-edge/
-
Make background image clickablehttps://wordpress.org/support/topic/make-background-image-clickable-2/
-
Hover mouse over header image – contrast changeshttps://wordpress.org/support/topic/hover-mouse-over-header-image-contrast-changes/
-
Background image is not responsivehttps://wordpress.org/support/topic/background-image-is-not-responsive-2/
-
Post header imagehttps://wordpress.org/support/topic/post-header-image-2/
-
Twentysixteen child theme help with image alignmenthttps://wordpress.org/support/topic/twentysixteen-child-theme-help-with-image-alignment/
-
Center Header in TwentySixteenhttps://wordpress.org/support/topic/center-header-in-twentysixteen/
-
how suppress header hover alternate imagehttps://wordpress.org/support/topic/how-suppress-header-hover-alternative-image-source/
-
Background image not showing correct on mobile devicehttps://wordpress.org/support/topic/background-image-not-showing-correct-on-mobile-device/
-
Add border to header image Twenety Sixteenhttps://wordpress.org/support/topic/add-border-to-header-image-twenety-sixteen/
-
How do you center your header image and Nav menu?https://wordpress.org/support/topic/how-do-you-center-your-header-image/