How to Skip images classes
-
Hey,
I want to skip featured image class from being lazy load so the featured images for the post can be viewed and indexed by the Google bot. I tried adding
“featured-image, attachment-colormag-featured-image size-colormag-featured-image wp-post-image” under the skip classes box, but it’s not working at all.Let me know if you can help me out.
Thanks,
Bunty-
This topic was modified 9 years, 1 month ago by
Bunty Pundir.
-
This topic was modified 9 years, 1 month ago by
-
The problem is with the pulgin itself. I tried above the code on Bj Lazy load plugin and it’s works fine. There is Post Thumbnail lazy load option in A3 lazy load pluing and it’s not working as well.
The plugin is really nice but I don’t want to de-index my feature post image from google. Better use BJ lazy load.
Just release Version 1.8.0 with those bug fixed, plus some new features and compatibility with WordPress 4.7.5, and PHP 7.0
Looks like you have opted for another plugin – but just letting you know that we have dealt with the issue and thanks for reporting it.
If you do use a3 lazy load on another project i am sure you will be happy with it.
Regards
SteveThanks for heads up Steve. I’m using this plugin, I managed to ignore lazy load for post thumbnail but still homepage other images being lazy load. Since you said that you dealt with this issue with the update, then let’s see whether it works or not!!
Hey Buddy,
Just updated as soon as I saw the new version. Now it’s giving the fatal error it’s says “fatal error: using $this when not in object context wp-content/plugins/a3-lazy-load/classes/class-a3-lazy-load.php on line 279”
You dealt with the issue or just introduced new one? Any solution right now I just deactivated it to keep the website running.
-
This reply was modified 9 years ago by
Bunty Pundir.
-
This reply was modified 9 years ago by
Bunty Pundir.
-
This reply was modified 9 years ago by
Bunty Pundir.
-
This reply was modified 9 years ago by
Bunty Pundir.
Hello @bunty-pundir
Just put out version 1.8.1 with a fix for that – can you please activate again / upgrade and confirm that the issue is fixed for you
Regards
SteveYeah, it’s fixed the issue. Earlier when I checked off ‘POST thumbnails’ button the plugin started to ignore lazy load for post featured image (what I want) but after upgrading, it is lazy loading the feature post image as well even the button is checked off.
You also said that now skipping image class option should work now but still it is not working at all. My post thumbnail post has a class colormag-featured-image, so tried to put this “no-lazy, lazy-ignore, colormag-featured-image” in Skip Images class box but no luck at all man. After adding this, it is still showing “lazy-hidden attachment-colormag-featured-image size-colormag-featured-image wp-post-image” on the featured image
Am I putting the class properly for lazy load ignore?
Hello @bunty-pundir
Thanks for telling me know that fixed that issue
Re the skip image class the syntax that you use
no-lazy, lazy-ignore, colormag-featured-imageis correct but it depends how the image is displayed – if it is by custom code and not by WordPress function then that would be why its not working.Can you post a link to a page where we can see the colormag-featured-image so we can inspect the code in a browser
Thanks for reply Steve, the colormag-featured-image class is in the content-page.php of my wordpress theme (I am using Colormag theme).
Here goes code for content single page:
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php do_action( ‘colormag_before_post_content’ ); ?><?php
$image_popup_id = get_post_thumbnail_id();
$image_popup_url = wp_get_attachment_url( $image_popup_id );
?><?php if ( has_post_thumbnail() ) { ?>
<div class=”featured-image”>
<?php if (get_theme_mod(‘colormag_featured_image_popup’, 0) == 1) { ?>
” class=”image-popup”><?php the_post_thumbnail( ‘colormag-featured-image’ ); ?>
<?php } else { ?>
<?php the_post_thumbnail( ‘colormag-featured-image’ ); ?> //notice this
<?php } ?>
</div>
<?php } ?><div class=”article-content clearfix”>
<?php if( get_post_format() ) { get_template_part( ‘inc/post-formats’ ); } ?>
<?php colormag_colored_category(); ?>
<header class=”entry-header”>
<h1 class=”entry-title”>
<?php the_title(); ?>
</h1>
</header><?php colormag_entry_meta(); ?>
<div class=”entry-content clearfix”>
<?php
the_content();wp_link_pages( array(
‘before’ => ‘<div style=”clear: both;”></div><div class=”pagination clearfix”>’.__( ‘Pages:’, ‘colormag’ ),
‘after’ => ‘</div>’,
‘link_before’ => ‘<span>’,
‘link_after’ => ‘</span>’
) );
?>
</div></div>
<?php do_action( ‘colormag_after_post_content’ ); ?>
</article>You can visit my website http://www.psdstack.com or any page to inspect the code. But if you check the code for featured image in your browser it won’t show you directly the “colormag-featured-image” class instead of that you’ll see “attachment-colormag-featured-image size-colormag-featured-image wp-post-image” and you know as it is already lazy load then it adds lazy-hidden before it. Also, I’m not showing the featured image using any custom code, it is default by the theme which I am using.
-
This reply was modified 9 years ago by
Bunty Pundir.
-
This reply was modified 9 years ago by
Bunty Pundir.
Thanks for the link – from what i can see the class name is
attachment-colormag-featured-image
Please try excluding that image class name and see if it works.
Regards
SteveI tried putting this with commas “no-lazy, lazy-ignore, attachment-colormag-featured-image” but it didn’t work. But then I removed the comma and now it is working fine. The skip image class is working like a magic and now happy with the plugin.
Regards,
Bunty -
This reply was modified 9 years ago by
The topic ‘How to Skip images classes’ is closed to new replies.