Support » Plugin: ShortPixel Adaptive Images » Images not showing in the loop

  • Hello,

    Please check the site. I have enabled the plugin. It seems to work only for single posts, but not for the posts in the loop.

    Here is how I am calling the thumbnails in the loop:

    <a href="<?php the_permalink() ?>" title="<?php echo get_the_title(); ?>"><img class="post-image" itemprop="image" src="<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>"></a>

    No caching plugins used.

    Do you see anything wrong?

    Thanks

    • This topic was modified 2 years, 2 months ago by utnalove.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support sixaxis

    (@sixaxis)

    Hi @utnalove,

    Please have a look at the following article, perhaps that will be able to solve the issue: https://help.shortpixel.com/article/220-i-ins

    Have a good one!

    Thread Starter utnalove

    (@utnalove)

    -Using the default CDN
    -no cache used
    -no lazy load used
    -no optimization plugins used
    -litespeed, jetpack, Hummingbird, autooptimize, WP Rocket, swift, SG Optimizer, WP Fastest Cache – nothing similar used

    my active plugins:
    Accelerated Mobile Pages
    Akismet Anti-Spam
    AMP Layouts
    Anti-Malware Security and Brute-Force Firewall
    Contact Form 7
    Contact Form 7 for AMP
    Custom Fields for Gutenberg Block Editor
    Markup (JSON-LD) structured in schema.org
    Meta Box
    ReCaptcha v2 for Contact Form 7
    ShortPixel Adaptive Images
    Simple Custom CSS and JS
    WP Mail SMTP
    WPML
    Yoast

    any idea?

    • This reply was modified 2 years, 2 months ago by utnalove.
    Thread Starter utnalove

    (@utnalove)

    I found what to change in order to make it work.

    If I replace
    <a href="<?php the_permalink() ?>" title="<?php echo get_the_title(); ?>"><img class="post-image" itemprop="image" src="<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>"></a>

    with:

    <?php the_post_thumbnail('full', array('class' => 'post_thumbnail_common post-image', 'alt' => get_the_title(), 'title' => get_the_title())); ?>

    Question 1:
    Why the firs case doesn’t work?

    Question 2:
    Can I fix somehow the first code? I would like to use a similar structure, because I need to keep the schema.org itemprop, alt, etc.

    Thread Starter utnalove

    (@utnalove)

    Anyway, I think I won’t use this plugin anymore… after turning it on the google insights for both mobile and desktop are much lower.

    If this is not what should happen, and the authors would like to investigate, I am open to give them access to the repository of my theme.
    If not, thanks anyway.

    Plugin Support sixaxis

    (@sixaxis)

    Good morning, @utnalove.

    The scores of Google PageSpeed Insights are a way to tell you how good a website is performing in general. If there wasn’t a score, it would be too difficult for the average user to understand the results. Such scores are a combination of many factors, most of them unrelated to ShortPixel. Since these factors change with each test, it is possible that they affect the overall score.

    In any case, we will be happy to take a look at your site. For this, please contact us here, make sure to mention this ticket and then we will continue from there 🙂

    Thank you!

    Thread Starter utnalove

    (@utnalove)

    Thank you. I think that it is important to optimize a site to score well, because it’s an official information from google, that good scoring is one of the many factors of optimalization and better SERP. Since we don’t know the algorythm, it’s good to try to fix what can be fixed. Without paranoia, but still.

    Thank you for your understanding and willingness to help. I’ll follow up there.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Images not showing in the loop’ is closed to new replies.