Post Thumbnail Without Width and Height
-
Hi there! I’m new to wordpress and php so be gentle.
I can’t figure out how to return a featured image in get_the_post_thumbnail and the_post_thumbnail without any size attributes attached to it. My design is completely responsive and having the height attribute on the image does not lend itself to be resized.
I would still like to take advantage of choosing which thumbnail size to return – just without the size attributes in the image tag.
I’m sure there is a way to do this. Any help is appreciated!
To be clear, I’d like to turn this:
<img width=”400″ height=”200″ src=”https://localhost:8888/wp-content/uploads/2013/07/hero_2-400×200.png” class=”attachment-post-thumbnail wp-post-image” alt=”hero_2″>
into this:
<img src=”https://localhost:8888/wp-content/uploads/2013/07/hero_2-400×200.png” class=”attachment-post-thumbnail wp-post-image” alt=”hero_2″>
- The topic ‘Post Thumbnail Without Width and Height’ is closed to new replies.