I've created a new custom post type and I need the post thumbnails or featured images generated by the get_the_post_thumbnail() function to be set in percent, rather than pixels, as I'm using a fluid grid. Ideally I would only set the width (to 100%). Is there a way to do this? Potentially using add_image_size()?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
have you tried,
|
|||||
|
|
|
It's not possible to change the units of the default width and height output, but you can possibly override the output via css:
Then you can override it via something like |
|||
|
|
|
I've solved that issue getting rid of all width and height attributes set by WP:
|
||||
|
|