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='",
$post_url,
"' title='",
$post_title,
"'><img width=\"",
$image[1],
"\" height=\"",
$image[2],
"\" src=\"",
$image[0],
"\"class=\"attachment-custom0\" alt=\"\" title=\"",
<strong>$attachments[0]->post_title</strong>,
"\" /></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.
Thanks.