Displaying responsive image in WordPress

Since WordPress 4.4, WordPress has its own way to display responsive images. The <img> tag can now hold a variety of sources that can be displayed based on the screen te page is viewed on.

Displaying a thumbnail image

The result:

The source:


Displaying a responsive image

get existing image sizes:


Add image size link

output: (I used another function to get extra details)

Add image attribute settings for the extra size


The result:


Leave a Reply

Your email address will not be published. Required fields are marked *