🎁 Get Up To 70% Off and a Free Prize During Divi Black Friday Sale! Get Divi

Show Title On Hover in Divi Filterable Portfolio Module

Blog, Divi Tutorial | 4 comments

In this article I will share the steps to show the Title on hover in the Divi filterable portfolio module.

I wrote an article on how to move title and meta to the overlay in the standard portfolio module a few days ago. But those steps do not work with the filterable portfolio module.

The code in this article will only focus on the filterable portfolio. And how to to show the title when you hover on top of the image.

Here is a preview of how it would look like at the end.

Show title on hover Divi filterable portfolio module

1. Add Custom CSS Class to Show Title On Hover

The first step is to add a custom css class to the filterable portfolio module. This is so that the code only affects this module and does not affect anything else on the website.

Open the Filterable Portfolio Module Settings > Advanced > CSS ID & Classes > CSS Class and then add the class lwp-title-portfolio to it.

Here is a screenshot to help if you are not sure where to add the css class.

CSS Class show title on hover Divi filterable portfolio module

2. Add Custom CSS Code To Show Title On Hover

The next step is to add the custom css code in the Divi theme options to show the title on top of the image when you hover over it.

Go to your WordPress Dashboard > Divi > Theme Options > Custom CSS and add the below code there.

.lwp-title-portfolio h2.et_pb_module_header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    margin-top: 0px!important;
    z-index: 3;
    opacity: 0;     /*hides title when not hovered*/
}

/*make title visible on hover*/
.lwp-title-portfolio .et_pb_portfolio_item:hover h2.et_pb_module_header {
    opacity: 1;
}

/*Removes the icon*/
.lwp-title-portfolio span.et_overlay:before {
    content: '';
}

/*fix for overlay not showing when you hover over the title*/
.lwp-title-portfolio .et_pb_portfolio_item:hover span.et_overlay {
    opacity: 1;
    z-index: 3;
}

Here is a screenshot of exactly where you need to add the css code in the Divi Theme Options.

Divi Custom CSS Theme Options to show title on hover in portfolio module

That is we are done. Now the title will appear on top of the image when you hover on it.

You can change the styles of the Title text such as size and color in the Module Settings > Design > Tab Title Text toggle. And the styles for the for Overlay in Module Settings > Design > Overlay toggle.

3. Custom CSS Code To Reverse the Effect

The code above shows the title on top of the image when you hover on it.

What if you want to create the reverse effect? Where the title and overlay are visible by default and get hidden when you hover on the image.

To achieve this effect instead of adding the code shared above you can use this code.

.lwp-title-portfolio h2.et_pb_module_header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    margin-top: 0px!important;
    z-index: 3;
    opacity: 1; /*show title when not hovered*/
}

/*hide title on hover*/
.lwp-title-portfolio .et_pb_portfolio_item:hover h2.et_pb_module_header {
    opacity: 0;
}

/*Removes the icon*/
.lwp-title-portfolio span.et_overlay:before {
    content: '';
}

/*Show overly by default*/
.lwp-title-portfolio .et_pb_portfolio_item span.et_overlay {
    opacity: 1;
    z-index: 3;
}

.lwp-title-portfolio .et_pb_portfolio_item:hover span.et_overlay {
    opacity: 0;
    z-index: 3;
}

Here are some other Divi tutorials that you might enjoy.

Don’t forget to subscribe to the Newsletter to receive the latest tutorials in your inbox. Leave a comment below if you found this helpful or have any questions related to this tutorial.

About the Author

The author of learnhowwp.com is a WordPress expert with over a decade of experience, specializing in Divi. Since 2014, they have built numerous WordPress sites and developed 8 Divi plugins with over 30,000 active installations. A former support team member at Elegant Themes, they launched learnhowwp.com in 2020 to share their in-depth knowledge of Divi. Now home to over 65+ articles dedicated to Divi tutorials and insights

4 Comments

  1. Pavol

    Hi, I am really gratefull for you tutorial. It works for desktop resolution, but once I jump to mobile (with 1 column porfotilo), all overlay texts are centered in the middle of page – not in the each portfolio images.
    I play with position property but without success. Could you help me please?
    Thanks

    Reply
    • Pavol

      In the visual builder it looks fine, but once I test page in browser it dont work.

      Reply
  2. Jan Brenninkmeijer

    I am trying your Divi Overlay Images plugin. The width of the overlay is constantly wider than the width of the image. Is there a possibility to narrow the overlay within Divi?

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Our Plugins Are Already Being Used On 30,000+ Amazing Websites.

We offer a 30 Day Money Back Guarantee on all plugins, so joining is Risk-Free!