Hide Slide Filename/Alternate Text Display onMouseOver

Support Area Forums Epic Hide Slide Filename/Alternate Text Display onMouseOver

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question:
  • Author
    Posts
  • #6808
    elwynvds
    Participant

    Hi

    How does one hide the filename/alternate text for a slide from displaying onMouseOver?

    Thanks

    #6815
    Bill Robbins
    Moderator

    I found a thread in the WordPress support forum about that. I have not tested the solution, but it appears that this would work to remove the title from any featured images. Here’s how to go about that:

    1. Go to the appearance section in your WordPress control panel and select edit to open up the theme editor.
    2. From the list of files on your right, choose functions.php and scroll down to the bottom.
    3. Just before the last ?>, paste this:
      
      add_filter('post_thumbnail_html', 'thumbnail_filter', 99, 5);
      
      function thumbail_filter($html, $post_id, $post_thumbnail_id, $size, $attr) {
         // you can alter the resulted HTML here
         $html = // remove title from $html
         return $html;
      }
      
    4. Save your changes.

    If all goes as expected that will remove the title. You can leave the alt text blank when uploading the files.

    Let me know if you have any questions or trouble,
    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Hide Slide Filename/Alternate Text Display onMouseOver’ is closed to new replies.