How to write “alt” tag in image for wordpress code?
Why would you want to avoid the_postthumbnail? It can give you the exact html you want if you use the right attributes. Anyway, you can access the title and alt tags of an image like this: // get the ID of the featured image $thumbnail_id = get_post_thumbnail_id( $post_id ); // retrieve title (an image is … Read more