menu

InfiniteAjaxScroll

Turn existing pagination into infinite scrolling pages with ease

Channels
Team

Would like to load pictures

April 9, 2020 at 3:09pm

Would like to load pictures

April 9, 2020 at 3:09pm
Hello, 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?
  • reply
  • like
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
  • reply
  • like

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>
Edited
  • reply
  • like
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">
Edited
  • reply
  • like
So I guess there is an issue with the srcset attribute
  • reply
  • like
Problem 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="">
  • reply
  • like

April 11, 2020 at 12:45pm
Glad to hear you solved it. Please note that v1 is very outdated and no longer supported. It's advised to upgrade to v3. Have a nice day!
  • reply
  • like
Yes, I used v1 on the example blog, but the picture issue is occurring with v3. I bought a license to upgrade :)
  • reply
  • like
Maybe you should run some tests with WordPress and its srcset image feature
  • reply
  • like