Title: Creating a hover caption on thumbnails
Last modified: August 19, 2016

---

# Creating a hover caption on thumbnails

 *  Resolved [roburdick](https://wordpress.org/support/users/roburdick/)
 * (@roburdick)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/creating-a-hover-caption-on-thumbnails/)
 * I would like to be able to do this. Maybe it’s a bit too tehnical for me. On 
   my home page I want the thumbnails to display the post title or image caption
   when hovering over with the mouse.
 * I have tried various workarounds which either did not work or implemented wrong.
   If anyone understands what I need and knows how I can do it, I would be very 
   grateful.
 * I am using thematic with a child theme. I am not great with php or javascript.
   This is my site.
 * [http://www.robertburdick.com/](http://www.robertburdick.com/)
 * I have seen something like what I want on the autofocus theme by alan cole: [http://allancole.com/themes/index.php?wptheme=AutoFocus](http://allancole.com/themes/index.php?wptheme=AutoFocus)
   
   I think he uses the loop differently, and when I try it, it all breaks!
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [roburdick](https://wordpress.org/support/users/roburdick/)
 * (@roburdick)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/creating-a-hover-caption-on-thumbnails/#post-1441936)
 * I found a post that sorted this out for me. Pop this bit of code in your functions.
   php file (for child themes set up):
 * ‘
 * // caption for thumbs
    function monahans_thumbnail_caption($html, $post_id, $
   post_thumbnail_id, $size, $attr) { $attachment =& get_post($post_thumbnail_id);
 *  // post_title => image title
    // post_excerpt => image caption // post_content
   => image description
 *  if ($attachment->post_excerpt || $attachment->post_content) {
    $html .= ‘<p 
   class=”thumbcaption”>’; if ($attachment->post_excerpt) { $html .= ‘<span class
   =”captitle”>’.$attachment->post_excerpt.'</span> ‘; } $html .= $attachment->post_content.'
   </p>’; }
 *  return $html;
    }
 * add_action(‘post_thumbnail_html’, ‘monahans_thumbnail_caption’, null, 5);
 * ‘

Viewing 1 replies (of 1 total)

The topic ‘Creating a hover caption on thumbnails’ is closed to new replies.

## Tags

 * [captions](https://wordpress.org/support/topic-tag/captions/)
 * [hover](https://wordpress.org/support/topic-tag/hover/)
 * [thumbnails](https://wordpress.org/support/topic-tag/thumbnails/)

 * 1 reply
 * 1 participant
 * Last reply from: [roburdick](https://wordpress.org/support/users/roburdick/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/creating-a-hover-caption-on-thumbnails/#post-1441936)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
