Featured Images
-
Hello Gijo,
is there a way to exclude the Featured Image from lazy loading in your plugin?
Greetings Kathrin
The page I need help with: [log in to see the link]
-
@topfgartenwelt add “wp-post-image” to the exclude list
Dear Gijo, I have tried that, but when the image couldn’t be loaded the placeholder collapses and causes a layout shift. I was trying the exclude function on my test server. So the images have a different link than on the live version. Could that be the reason?
Greetings Kathrin
@gijo
While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.
Thankfully are other ways to get information you need:
- Ask the user to install the Health Check plugin and get the data that way.
- Ask for a link to the http://pastebin.com/ or https://gist.github.com log of the user’s web server error log.
- Ask the user to create and post a link to their
phpinfo();output. - Walk the user through enabling WP_DEBUG and how to log that output to a file and how to share that file.
- Walk the user through basic troubleshooting steps such and disabling all other plugins, clear their cache and cookies and try again (the Health Check plugin can do this without impacting any site vistors).
- Ask the user for the step-by-step directions on how they can reproduce the problem.
You get the idea.
We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.
When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves. That’s how we get the next generation of developers.
You’ve been placed on “modwatch” until we’re convinced such postings have stopped. Your account has *not* been banned, we just want to check things for a while before they’re public. If you wish to take issue with this, contact moderators via the #forums channel on slack ( https://make.ww.wp.xz.cn/chat )
If you need to contact the moderators about this then you can do so via the Slack #forums channel.
To use that channel you need a Slack account. You can obtain one via these instructions.
Slack – https://make.ww.wp.xz.cn/chat/
When you contact the #forums channel, inform them what your ww.wp.xz.cn forum user ID is. That will help the moderators find your account and ascertain what the issue is.
If you do use Slack do not direct message me or any other moderator. Use the #forums channel and any moderator there can assist you.
Forum topics will only be edited or deleted if they represent a valid legal, security, or safety concern.
See https://ww.wp.xz.cn/support/guidelines/#deleting-editing-posts and https://ww.wp.xz.cn/about/privacy/
Sorry, I didn’t want that something like that happens. I have installed WP health Plugin, I had already disabled all other plugins, but there is no change. The plugin works perfectly on the site that is already online http://www.topfgartenwelt.com, but not on the test-site http://bzvqew.myraidbox.de. The test-site includes the same pictures as http://www.topfgartenwelt.com.
On the test-site I was trying a new theme and everytime I want to use the plugin here, the pictures are not delivered via CDN and the placeholder for the images collapses. It would be nice if it works that the placeholder is stable also when the images couldn’t be delivered via CDN.
Maybe the CDN doesn’t work because the access is blocked by the test-site which is a copy of the normal blog?
Greetings Kathrin
Why you say the issue is resolved? There is still a problem!
I could get it work that the images are delivered via CDN after turning on SSL for the test-blog. But when I run a Page Speed Test I get the information that the images have no explicit height and width. That wasn’t any issue before. Why?
Greetings Kathrin
1) “when the image couldn’t be loaded the placeholder collapses and causes a layout shift”. Did you find why the image couldn’t be loaded? What is in the SRC attribute? What is the “placeholder”?
2) “images have a different link than on the live version” the image should be from where the origin of the site is. But it doesn’t apply to lazy loading.
3) “CDN doesn’t work because the access is blocked by the test-site” – is the image rewritten to Statically CDN URL? If so and then the image is not loading, you should contact Statically.
4) “I get the information that the images have no explicit height and width” – Flying Images doesn’t add or remove width and height attributes. You should contact your theme developer regarding this.
Your original post is about “how to exclude featured image from lazy loading”. I’ve already answered it. Add “wp-post-image” to the exclude list.
Ok, thanks for your answer. I have already excluded the featured images from the post pages and it works fine. But now all the images on the homepage and archivpages are also excluded from lazy loading. On the homepage and the archiv-pages only the first featured image should be excluded from lazy loading. How can this work?
I got that code from my theme developer:
// Add skip-lazy class ( or any class ) to featured image of latest post function skip_lazy_class_first_featured_image($attr) { global $wp_query; if ( !is_single() && 0 == $wp_query->current_post ) { $attr['class'] .= ' skip-lazy'; } return $attr; } add_filter('wp_get_attachment_image_attributes', 'skip_lazy_class_first_featured_image' );But I don’t know how this should work, when all featured images are already exluded from lazy load also on homepage and archiv-pages.
Greetings Kathrin
@topfgartenwelt maybe all the featured images on the home page and archive pages will have the same class “wp-post-image”.
You can ask the theme developer or hire someone to add a special class to featured images only in post pages.
The topic ‘Featured Images’ is closed to new replies.