Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

Disable Image Title on Hover/Mouseover


  • Aaron
    Newbie 9 points
    March 19, 2019 at 12:38 am

    Hi All,
    How would I go about disabling the image title displaying upon hovering over the image (using a mouse on desktop)? I cannot seem to disable this within Elementor, through the Additional CSS field in WordPress, or through CPanel (screenshot attached).

    Thanks in advance!
    -Aaron

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    Super Guru 1,345 points
    March 19, 2019 at 3:58 am

    Hello Aaron,
    Try adding something like this to your custom javascript file:

    jQuery(".elementor-image img").attr('title','')

  • Aaron
    Newbie 9 points
    March 19, 2019 at 6:55 pm

    Hi James,

    Thank You for reaching out! I attempted to add this to various sections that would apply the rule sitewide (header, custom js file, etc.), however, the titles are still appearing upon hover. Is there a specific section that this needs to be applied?

    Thanks James!
    -Aaron

  • JamesD
    JamesD
    Super Guru 1,345 points
    March 19, 2019 at 8:41 pm

    Hello Aaron,
    Put it in the jQuery(document).ready section of your javascript file. If it doesn’t have a section then place this at the bottom of the file:

    jQuery(document).ready(function(){
    jQuery(".elementor-image img").attr('title','')
    });

    Note: This should work with images within .elementor-image elements, not all images. Also, keep in mind that the image title can be taken into consideration with SEO. Removing them could have a potential impact.

    For ALL images you would use something like this (I don’t think it’s a good idea):

    jQuery(document).ready(function(){
    jQuery("img").attr('title','')
    });

    If for some reason none of the above doesn’t work then zip up your custom javascript file, attach it here and let me know the location the file within your theme.

  • JamesD
    JamesD
    Super Guru 1,345 points
    March 19, 2019 at 8:46 pm

    @Aaron
    Note: I noticed a JS error on your site. Errors like this can break other JS on the page. So, if this is being caused by JS other than what we’ve been discussing then it should be correct first.


  • Aaron
    Newbie 9 points
    March 19, 2019 at 9:33 pm

    That did the trick, James, Thank You so very much!

    While I understand the title information is a ranking factor for SEO, I would rather optimize the alt text, so I’m happy that this is still intact.

    Thank You once again, I greatly appreciate you looking into this.

    All the best,
    -Aaron

  • JamesD
    JamesD
    Super Guru 1,345 points
    March 19, 2019 at 10:45 pm

    @Aaron,
    No worries, I’ll try to generalize more.
    Note: If you’re using the default DT theme and you want to customize it without directly editing core files then you may want to use the boiler creator to duplicate the default files needed. Then you could make changes without worrying about messing up the original DT default if something goes awry or if DT9 is upgraded. (Everything will be overwritten on the next DT9 upgrade using original files).

    With that aside, to accomplish this with the original files then add the following near the bottom of your /DT9/_directory/template/_functions.php file.

    Now unzip and upload the attached _custom.js file into the /DT9/_directory directory.
    That should be it. Let me know if you hit any speed bumps.

    Boiler


    Note: This is one of my projects to help PP members. II’m not affiliated with PremiumPress other than a theme owner, so feel free to reach out to me (contact info in boiler files) for assistance/questions with it.

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    Super Guru 1,345 points
    March 19, 2019 at 11:16 pm

    @Aaron
    Glad it helped. Sorry about the last post, disregard..

Viewing 8 posts - 1 through 8 (of 8 total)