Title: Remove Img Title
Last modified: August 19, 2016

---

# Remove Img Title

 *  Resolved [noelgreen](https://wordpress.org/support/users/noelgreen/)
 * (@noelgreen)
 * [16 years ago](https://wordpress.org/support/topic/remove-img-title/)
 * I have the following code to grab the thumbnail images from the posts.
 *     ```
       <?php
       $attachments = get_children("post_parent={$post->ID}&post_type=attachment&post_mime_type=image&numberposts=1");
       foreach ( $attachments as $att_id => $attachment) {
       echo wp_get_attachment_image($att_id, 'thumbnail');
       }
       ?>
       ```
   
 * That works great. But I need to remove / not display / hide the “Title” of the
   image. So that when someone does a mouse over on the image it won’t display the“
   title” as a pop-up.
 * Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [noelgreen](https://wordpress.org/support/users/noelgreen/)
 * (@noelgreen)
 * [16 years ago](https://wordpress.org/support/topic/remove-img-title/#post-1490183)
 * Figured it out.
    Based [on this post](http://wordpress.org/support/topic/317534)
   I changed my code to this.
 *     ```
       <?php
       $featured_image = array();
       $args = array(
       	'post_type' => 'attachment',
       	'numberposts' => 1,
       	'post_status' => null,
       	'orderby' => ID,
       	'post_parent' => $post->ID
       	);
       $attachments = get_posts($args);
       if ($attachments) {
       	foreach ($attachments as $attachment) {
       		$featured_image = wp_get_attachment_image_src($attachment->ID, $size='thumbnail', $icon = false);
       	}
       }
       echo '<img src="' . $featured_image[0] . '" alt=""/>';
       ?>
       ```
   
 *  [crunchytoast420](https://wordpress.org/support/users/crunchytoast420/)
 * (@crunchytoast420)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/remove-img-title/#post-1490379)
 * Also, in 2.9.2 you can open up media.php and comment out line 565.
 *     ```
       //'title' => trim(strip_tags( $attachment->post_title ))
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove Img Title’ is closed to new replies.

## Tags

 * [get_children](https://wordpress.org/support/topic-tag/get_children/)
 * [hide](https://wordpress.org/support/topic-tag/hide/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [title](https://wordpress.org/support/topic-tag/title/)
 * [wp_get_attachment_image()](https://wordpress.org/support/topic-tag/wp_get_attachment_image/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [crunchytoast420](https://wordpress.org/support/users/crunchytoast420/)
 * Last activity: [15 years, 12 months ago](https://wordpress.org/support/topic/remove-img-title/#post-1490379)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
