WordPress.org

Ready to get started?Download WordPress

Forums

Remove Title from Featured Image / Thumbnail (8 posts)

  1. Connor Crosby
    Member
    Posted 3 years ago #

    I am making a WordPress theme and I am using the featured image / thumbnail feature.

    <?php if(has_post_thumbnail()) { the_post_thumbnail('related-post-thumbnail'); } else {
    echo '<img src="'.get_bloginfo("template_url").'/images/no-thumbnail-small.png" />'; } ?>

    The only problem is whenever someone hovers over the image, there is a title attribute. How can I remove this without going into the WP files outside of my theme files? Thanks!

  2. dikkevandale
    Member
    Posted 3 years ago #

    I would like to know this too!

    Frustrating, because the image titles are often like 8a3rha3a3ja3r.jpg and I don't have time to rename all those images. So I would like to use the_title(); for image titles.

    Any solution yet?

  3. Connor Crosby
    Member
    Posted 3 years ago #

    Sadly, not yet. I think you have to edit the files to get this.

  4. dikkevandale
    Member
    Posted 3 years ago #

    Ok, I will share if I find something :) I don't want to mess with the core files.

  5. Connor Crosby
    Member
    Posted 3 years ago #

    Alright, same. Thank you :)

  6. themolitor
    Member
    Posted 3 years ago #

    <?php the_post_thumbnail('related-post-thumbnail',array('title' => "")); ?>

    More info here: http://codex.wordpress.org/Function_Reference/the_post_thumbnail

  7. Connor Crosby
    Member
    Posted 3 years ago #

    Oh, thank you!!

  8. Adam
    Member
    Posted 2 years ago #

    @themolitor

    Thanks! Worked for me also. (Using WP 3.2.1)

Topic Closed

This topic has been closed to new replies.

About this Topic