Would like to load pictures
April 9, 2020 at 3:09pmWould like to load pictures
April 9, 2020 at 3:09pmHello, I'm using ias to load posts on a blog page, each item goes with a featured image which isn't loaded… Can't find a way to do it and found no example. I don't use masonry or any other script… guess I'll have to use imagesloaded?
April 9, 2020 at 7:17pm
Hi Thomas, images should load normally as can be seen in one of the examples: https://infiniteajaxscroll.com/examples/articles/
Unless there is some special loading going on. Can you share the website you are working on so I can inspect it?
Thanks! Sure the website is: https://fromscratch.anybodesign.com/fs-blog/
But it's running ias 1.1.0, the html markup is the same, and CSS as weel
April 10, 2020 at 8:03am
Hi Jeroen, I think I've found what's causing the issue… the WordPress image markup.
When I replace the featured image by a fallback, the posts load correctly:
<div class="post-picture"><a href="http://fromscratch.wp/fs-blog/fluffy-puppies/"><img src="http://fromscratch.wp/fs-blog/wp-content/themes/FS-blog/img/fallback.png" alt=""></a></div>
Whereas the WordPress markup is:
<img width="1280" height="640" src="http://fromscratch.wp/fs-blog/wp-content/uploads/sites/2/2016/11/photo-1447014421976-7fec21d26d86-1280x640.jpeg" class="attachment-blogpost-hd size-blogpost-hd wp-post-image" alt="" srcset="http://fromscratch.wp/fs-blog/wp-content/uploads/sites/2/2016/11/photo-1447014421976-7fec21d26d86-1280x640.jpeg 1280w, http://fromscratch.wp/fs-blog/wp-content/uploads/sites/2/2016/11/photo-1447014421976-7fec21d26d86-640x320.jpeg 640w" sizes="(max-width: 1280px) 100vw, 1280px">
So I guess there is an issue with the
srcset
attributeProblem solved using the classic img tag and no
srcset
attribute :)<?php if ( '' != get_the_post_thumbnail() ) {$img_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'blogpost' );?><img src="<?php echo $img_url[0]; ?>" alt="">
April 11, 2020 at 12:45pm
Yes, I used v1 on the example blog, but the picture issue is occurring with v3. I bought a license to upgrade :)
Maybe you should run some tests with WordPress and its srcset image feature