Skip to content
Advertisement

How to hide alt tag output on page?

Please check the screenshot, let me know how to fix this issue…And you can see there’s no image alt data in HTML. Another thing is that if I use PHP in img src so I can’t set width & height like (300 x 300). The output is a full-size image and if I use a static URL in img it works fine, how to deal with that?

JavaScript

enter image description here

enter image description here

Advertisement

Answer

Use get_the_post_thumbnail_url() to get post image url as get_the_post_thumbnail() returns html with img tag. get_the_post_thumbnail_url() will return only image url.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement