Viewing 11 replies - 1 through 11 (of 11 total)
  • That’s kind of the point.

    This shows you how to add the featured image to AMP in a valid way.

    @isabel104 the link you provided is broken. I would love to see how you accomplished this. Could you provide another source?

    The link works fine. (Could the page have been momentarily down?) I just checked, and it appears to be fine. Here it is again:

    Add Featured Image To Accelerated Mobile Pages in WordPress

    AMP format only shows the content from the “post content” — meaning, “featured” images “outside” the post content don’t appear, such as a background image, or similar.

    See the AMP plugin docs on how to customize the template, and also how to enable things like Google Analytics.

    You’ll also need to manually setup advertising per however the latest AdSense code might be for AMP specifically as it’s not the existing setup you’ve been using for desktop/mobile responsive.

    Remember this only launched a month ago, so it’s still very transitional. If you rely on ad dollars, you likely should NOT activate AMP right now until you better understand how this impacts ad views. You might want to only have hosted ads via AMP where you load those in the template from your own site; or see the AdSense support pages for latest info re AMP support as it rolls out.

    This addon resolves the featured image issue, along with other shortcomings – e.g., it adds analytics, featured posts and even a menu: https://www.ads-software.com/plugins/custom-amp-accelerated-mobile-pages/changelog/

    Caveat: I deployed this about an hour ago, so it remains to be seen whether Google will now tell me my AMP pages are full of errors. But so far it’s the best alternative I’ve found. There is also another plugin on the repository that goes even further in terms of layout refinements, but it’s shady as heck (e.g., it wants access to you analytics) so beware.

    And of course there’s already an AMP plugin on Codecanyon (with terrible reviews), so the gold rush has begun…

    I put together a simple AMP featured image solution on my blog, please test and let me know if it works for you. Also, the Glue plugin by Yoast allows you to input Google Analytics code to track the success of your AMP pages. Make sure that you enter the analytics code correctly.

    Illustrated below:

    <amp-analytics type=”googleanalytics” id=”analytics1″>
    <script type=”application/json”>
    {
    “vars”: {
    “account”: “UA-XXXXXXXX-1”
    },
    “triggers”: {
    “trackPageview”: {
    “on”: “visible”,
    “request”: “pageview”
    }
    }
    }
    </script>
    </amp-analytics>

    <p class="xyz-featured-image"><amp-img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ) ?>" sizes="(min-width: 620px) 620px, 100vw" class="amp-wp-enforced-sizes -amp-element -amp-layout-responsive -amp-layout-size-defined -amp-layout" id="AMP_2" style="width: 620px;"><i-amp-sizer style="display: block; padding-top: 75%;"></i-amp-sizer><img amp-img-id="AMP_2" class="-amp-fill-content -amp-replaced-content" width="620" height="465" src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ) ?>"></amp-img></p>

    this code works for me great

    Hello Friends,

    I Tried to use AMP Plugin, but my post not showing Content. In AMP url show only Feature Image & Blob tile. Here you can check.

    Original : https://blog.softwaresuggest.com/ways-performance-management-revolutionizing-hrm

    AMP : https://blog.softwaresuggest.com/ways-performance-management-revolutionizing-hrm/amp/

    Please help or update.

    Thank you,

    Hi!, I installed Custom AMP plugin, but my Featured Image is not showing (it is blank):
    https://projectmanagers.org/salary/amp/

    Can anyone help me please?

    All the best,
    Angel

    Pierrot

    (@pierreto007)

    I try some solution from here but nothing work, then i resolve problem with AMP Supremacy plugin who work well :
    https://www.ads-software.com/plugins/amp-supremacy/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Featured image not showing on AMP’ is closed to new replies.