Home Forums General Issues Image srcset for external images


Image srcset for external images

  • I was wondering if there’s an extension or some way to create a custom field in which I can drop an image url that’s not part of WordPress library and later extract in theme an img tag with srcset.

    for example, if I paste url like this:

    I want to get something like this:

    <img srcset="// 400w, // 600w" sizes="(max-width: 1200px) 400px, 600px" src="//" alt="">

  • No. This is dependent on WP knowing what other images exist matching the aspect ratio of the image. WP cannot know what other image sizes exist on some other server.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.