Does anyone know how I can add id="" to thumbnails in index.
<img class="alignleft size-thumbnail wp-image-104" title="my_image" src="my_image-150x150.jpg" alt="" width="150" height="150" />
WordPress just adds class, but I need id too :)
Does anyone know how I can add id="" to thumbnails in index.
<img class="alignleft size-thumbnail wp-image-104" title="my_image" src="my_image-150x150.jpg" alt="" width="150" height="150" />
WordPress just adds class, but I need id too :)
Why do you need to add id? You can access it with the parent tag.
for example if the code looks like this . . .
<div id="post">
<img class="alignleft size-thumbnail wp-image-104" title="my_image" src="my_image-150x150.jpg" alt="" width="150" height="150" />
</div>
Then you can access it by #post img{width=200px;}
I need the ID tag because I'm adding custom jquery tooltips to thumbnail images.
do something like this:
$attr = array(
'id' => 'slide_thumb_'.$post->ID
);
echo get_the_post_thumbnail( $post->ID, 'thumbnail', $attr );
Then you can use #slide_thumb_<your_post_id> as selector.
also see http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
BR\ME
Could you please tell me how to implement that?
You must log in to post.