• I couldn’t really come up with the language to search for how to do this.

    Basically, I use the post thumbnail function all over my site. I don’t really want the blog titles cluttering up the page, so I would like a way to include the post’s title whenever a thumbnail is hovered over. This could be alt-text or some kind of a javascript pop-up, but I’m unsure how to go about it.

    Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • just add title”<?php the_title(); ?>” to img src line code

    it will look some thing like this

    <img src=”your image” alt=”some alt” title=”” >

    Thread Starter bpetruzzo

    (@bpetruzzo)

    That’s the problem, the img tag is being generated by the_post_thumbnail and I’m not sure how to get the alt text in there.

    Though I think I would prefer something in javascript/jQuery that wouldn’t require the user to hover their mouse over for a few seconds. But I’m really unsure how to phrase that kind of thing to search for it.

    Thread Starter bpetruzzo

    (@bpetruzzo)

    This is my code snippet:

    <li class="sidebar_recentposts">
    <h1>Recent Posts</h1>
    <?php query_posts('showposts=5'); ?>
          <?php while (have_posts()) : the_post(); ?>
            <a href="<?php the_permalink() ?>" class="sidebar_thumb"><?php the_post_thumbnail( 'sidebar-thumb', array('alt' => 'alttext')); ?></a>
    
          <?php endwhile;?>
    </li>

    I thought that array('alt' => 'alttext')); would do the trick with a custom field, but it’s not working the way I expected.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blog Title on Thumbnail Mouse Over’ is closed to new replies.