Tagged: alt text, featured image, Portfolio
-
AuthorPosts
-
October 31, 2017 at 5:22 pm #870894
I’ve set up an portfolio with team members. When I hover the featured image, i see in the alt text the complete title. Actually I want to see nothing when hovering that image. Is that possible?
October 31, 2017 at 5:29 pm #870900Hey martinvanderharst,
Try adding this code to the footer.php file:
<script type="text/javascript"> /* The first line waits until the page has finished to load and is ready to manipulate */ $(document).ready(function(){ /* remove the 'title' attribute of all <img /> tags */ $("img").removeAttr("title"); }); </script>
Best regards,
Jordan ShannonNovember 2, 2017 at 1:20 pm #871639Tried this, but no succes. See this screenshot:
November 2, 2017 at 5:08 pm #871758Hi,
Try adding it to functions.php instead:
function add_custom_code(){ <script type="text/javascript"> /* The first line waits until the page has finished to load and is ready to manipulate */ JQuery(document).ready(function(){ /* remove the 'title' attribute of all <img /> tags */ JQuery("img").removeAttr("title"); });} add_action('wp_footer', 'add_custom_code');
Best regards,
Jordan ShannonNovember 2, 2017 at 10:02 pm #871858gives me a white screen and no active website at all !
November 3, 2017 at 3:52 am #871914Hi,
Apologies, if possible if you can access the functions.php file via ftp or cpanel you can remove the code above to restore the site.
Best regards,
Jordan ShannonNovember 6, 2017 at 4:04 pm #873117Any other options to remove the alt text?
November 6, 2017 at 4:20 pm #873128Hey!
Please refer to this post – https://kriesi.at/documentation/enfold/remove-image-titles-that-show-up-when-you-hover-on-images/
Cheers!
YigitNovember 6, 2017 at 4:26 pm #873132i think it was the function name – with the white screen
you have to prove always if you have used it allready. If a function name is there twice it ends up in a white screen.by the way – have a look to your team member page: https://kriesi.at/themes/enfold-2017/elements/team-member/
do you see images – i guess they have the test.kriesi.at link in it ( thats the past)
by the way – i don’t like file names too – there is a fix to show the description instead :
on galleries or images:function gallery_title_fix(){ ?> <script> (function($){ $(window).load(function() { $('.lightbox-added img').each(function(){ var lin = $(this).attr('alt'); $(this).attr('title',lin); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'gallery_title_fix');
November 6, 2017 at 4:38 pm #873145Okay, now it’s working. Thank you for the support.
November 6, 2017 at 4:58 pm #873162Hi,
I’m glad you were able to get this corrected. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘remove alt text when hovering portfolio image’ is closed to new replies.