RWP to srcset images from Flickr
-
Hi Stefan,
I came across your plugin that seems to do what I want, but my case is a bit different.
My blog posts have lots of photos. I inserted them with WP Flickr Embed plugin, and the code looks like
<div style="width: 510px" class="wp-caption aligncenter"> <a href="http://farm4.static.flickr.com/3788/flickr-url_b.jpg" data-lightview-group="xxx" data-lightview-options="xxx" class="lightview" title="xxx" rel="lightbox" data-lightview-title="xxx"> <img title="xxx" src="https://farm4.staticflickr.com/3788/flickr-url.jpg" alt="xxx" width="500" height="375" /> </a> <p class="wp-caption-text">Caption</p> </div>My theme got upgraded to a responsive version and I want my photos to use the no-more fixed-width layout. By the way, in the new theme, I noticed the <div> got replaced by <figure> and <figcaption>.
I would like, without modifying all my previous posts and thousands of embedded Flickr pictures, that width becomes 100%, and add srcset so that pictures of different sizes are picked up by the browser . As you may already know, Flickr stores images of different sizes that can be easily retrieved by changing the last letter of the URL (cf: https://www.flickr.com/services/api/misc.urls.html ).
I am referring to you to know what would be the safest and cleanest way to do this. I have no experience with PHP but am ready to trial-and-error with bits of code. I understood that I can either use your plugin and modify it so that it picks up Flickr URLs (I am not interested in applying it to my few images present in the WP media library), or create a filter in functions.php of my child theme that basically search/replace to get my desired result.
Thank you for providing any hint,
JB
The topic ‘RWP to srcset images from Flickr’ is closed to new replies.