Support » Fixing WordPress » thumbnail titles do not update with post image titles

  • vlane


    Hi, first time poster…

    I have a recent links in my sidebar, but instead of text, the links are custom-size thumbnails of the image in each post.

    The links work fine, but I am having a problem with the mouse-over text that appears with the thumbnails.

    I retrieve the text/thumbnails with the following:

    $side_posts = get_posts('numberposts=12');
            foreach($side_posts as $post)
    		$args = array(
    			'post_type' => 'attachment',
    			'numberposts' => 1,
    			'post_status' => null,
    			'post_parent' => $post->ID
    		$attachment = get_posts($args);
    		if ($attachments)
    			$image = wp_get_attachment_image_src($attachments[0]->ID, $size='custom0', $icon=false);
    			if ($image != false)
    				echo "<a href='",
    				"' title='",
    				"'><img width=\"",
    				"\" height=\"",
    				"\" src=\"",
    				"\"class=\"attachment-custom0\" alt=\"\" title=\"",
    				"\" /></a>\n";

    the problem is that this will only retrieve the title that was originally input with the uploaded image. If I modify the title via the dashboard, this does not modify the text for the thumbnail.

    For example:

    If i upload an image and title it “omfortable…”, and then later modify it, via the dashboard, to read, “comfortable…”, when i mouse-over the post image, it reads “comfortable”, but when i mouse-over the sidebar-thumbnail, it still reads, “omfortable”.

    Any thoughts on this? Does it have to do with how wp modifies posts via revisions? I’m pretty stuck on this.


Viewing 1 replies (of 1 total)
  • vlane


    ok, so to change the original title, you have to use the uploader gallery/media library function.

    changing the title by clicking on an image already inserted into a post doesn’t work.

    i still have no idea where the alt title is stored in the wp database though.

Viewing 1 replies (of 1 total)
  • The topic ‘thumbnail titles do not update with post image titles’ is closed to new replies.