{"id":1492076,"date":"2010-05-08T03:07:52","date_gmt":"2010-05-08T03:07:52","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/the_post_thumbnail-issue-with-image-alt-attribute\/"},"modified":"2016-08-19T17:48:45","modified_gmt":"2016-08-19T17:48:45","slug":"the_post_thumbnail-issue-with-image-alt-attribute","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/the_post_thumbnail-issue-with-image-alt-attribute\/","title":{"rendered":"the_post_thumbnail() issue with image &#8216;alt&#8217; attribute"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I really want to know, is there any way to use alt attribute with the_post_thumbnail() function. for example I use following code to show featured post gallery in front page in my blog <a href=\"http:\/\/www.worthytips.com\/\">http:\/\/www.worthytips.com\/<\/a> :<\/p>\n<blockquote>\n<p>&lt;div id=&#8221;featured&#8221; class=&#8221;clearfix&#8221;&gt;<br \/>\n&lt;?php $recent = new WP_Query(&#8220;cat=824&amp;showposts=3&#8221;); while($recent-&gt;have_posts()) : $recent-&gt;the_post();?&gt;<\/p>\n<p>        <a>&#8221; title=&#8221;&lt;?php the_title(); ?&gt;&#8221; class=&#8221;featured_post&#8221;&gt;<br \/>\n        \t&lt;div class=&#8221;featured_post_inner&#8221;&gt;<\/p>\n<p>            &lt;div class=&#8221;attach&#8221;&gt;&lt;?php the_post_thumbnail(array(150, 150, true)); ?&gt;&lt;\/div&gt;<\/p>\n<p>            &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;\/h2&gt;<br \/>\n            &lt;\/div&gt;<br \/>\n        <\/a><\/p>\n<p>&lt;?php endwhile;?&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<\/blockquote>\n<p>Can anyone tell me how to put &#8216;alt&#8217; image attribute on generated thumbnail.<\/p>\n","protected":false},"template":"","class_list":["post-1492076","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1492076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1492076\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1492076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}