themes
themes copied to clipboard
Apostrophe 2: Lazy Images Causes Duplicate Images on Home Page
Chrome Browser version Version 66.0.3359.181
When Automatically use first image in post and Display on blog and archives are active in Content Options, Jetpack's Lazy Images module causes duplicate images to appear on the home page for posts with no selected Featured Image.
I found this while doing a guided transfer for a user. I've disabled Lazy Images on that site for now and not mentioned it to them. All is well on the user's site.
I am able to replicate this on my test site.
Steps to replicate
- Open the Customizer and go to Content Options.
- Select both Display on blog and archives and Automatically use first image in post. Publish those changes.
- Go to Jetpack → Settings → Discussion.
- Activate Lazy load images.
- Create a post with images in the body but no featured image selected.
- Observe the duplicate images on the home page.

From Inspect Element:
<img src="https://i2.wp.com/tracyspress.net/wp-content/uploads/2018/04/ast3.jpg?zoom=2&resize=224%2C224&crop=1" title="Galleries in Email" class="attachment-post-thumbnail wp-post-image jetpack-lazy-image--handled" data-lazy-loaded="1" width="224" height="224" srcset="https://i2.wp.com/tracyspress.net/wp-content/uploads/2018/04/ast3.jpg?zoom=2&resize=224%2C224&crop=1" src-orig="https://i2.wp.com/tracyspress.net/wp-content/uploads/2018/04/ast3.jpg?resize=450%2C450&crop=1" scale="2">
<img src="https://i2.wp.com/tracyspress.net/wp-content/uploads/2018/04/ast3.jpg?zoom=2&resize=224%2C224&crop=1" title="Galleries in Email" class="attachment-post-thumbnail wp-post-image" width="224" height="224" srcset="https://i2.wp.com/tracyspress.net/wp-content/uploads/2018/04/ast3.jpg?zoom=2&resize=224%2C224&crop=1" src-orig="https://i2.wp.com/tracyspress.net/wp-content/uploads/2018/04/ast3.jpg?resize=450%2C450&crop=1" scale="2">
Result
Duplicate images appear for posts with no featured image.
Expected
Only one image would appear for each post.
- Follow-up ticket: No need to follow up here.
- User's site: https://tracyspress.net/ (This is my test site. I've left the theme and Lazy Images in place for now. )
We've had another report of this issue in 1576490-z and I can confirm I was able to replicate by following the steps Tracy laid out.
I can recreate this on my AT test site as well.
Also reported in #2099736-hc, disabling Lazy Load in Jetpack resolved the issue
11534469-hc
#2136973-zen
Turning off lazy load resolved the issue.
Another report in 2192057-zen.
Also reported at 2207999-zen
This also happens if you set up a Testimonials page. So I believe it's featured image-related.
Another one reported at #2795391-zen
I had another instance of this: 23133698-hc
I used a CSS workaround:
/*Hide duplicated featured image on front page 23133698-hc sy*/
article .wp-post-image:last-child {
display: none;
}
#25094225-hc
Gave the CSS workaround and suggested using featured images for future, to make sure the site is ready for future themes.
#24589384-hc
Suggested they disable lazy load and that did the trick.
Another report: #3459502-zen
Another report in 25349441-hc
Another: 26114907-hc
Got a report here: 26651887-hc
30343723-hc & 23138678-hc
32283363-hc
Another report here: 4644512-zd-woothemes
Another report here: 34996016-hc I didn't see this bug while chatting so I used a CSS workaround:
.home .entry-thumbnail img:first-child {
display: none;
}
I can confirm this is still an issue.
As a part of this repository’s maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.
@Automattic/dotcom-pa-group, opening this again as the priority is still set as high. Would it make sense to lower the priority given it's one of our old themes?
Apostrophe 2 is currently active on at least 263,488 sites.
I'm setting this to Normal for now. cc @jeffikus
#5254229-zen I turned off Lazy Load as a workaround for them
As a part of this repository’s maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.
Another case here- 5373951-zd-woothemes Disabled lazy loading.
As a part of this repository’s maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.
Another case in 35851604-hc, turning off lazy loading removed the duplicate images
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 2136973-zen
- [ ] 2192057-zen
- [ ] 2207999-zen
- [ ] 2795391-zen
- [ ] 3459502-zen
- [ ] 4644512-zen
- [ ] 5254229-zen
- [ ] 5373951-zen