• Resolved cd_BE

    (@cd_be)


    Hi

    I have a future image and we embed that image in our post. Because the theme doesn’t show it in the post. We can’t change the theme, sadly.

    On the mobile AMP version the future image is now show at the post, so now we have that image twice. Is there a way to disable the show future image in pages loaded with AMP?

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • To ensure AMP compatibility reader mode disregards your active theme and its settings. (As you mentioned you theme doesn’t display featured images). What you could do is add the following code to your functions.php file.

    add_action( 'amp_post_template_css', function() {
    	?>
    amp-img .wp-post-image{display:none }
    	<?php
    } );

    There are some CSS plugins you could use as an alternative, making it easy to add CSS. Just test them to ensure they work on AMP endpoints.

    • This reply was modified 5 years, 5 months ago by James Osborne.
    Thread Starter cd_BE

    (@cd_be)

    Hi, thanks for the info.

    My theme has Custom CSS/Js so I can try to add the code there.

    I’m not a big fan of adding code to functions php.

    Thread Starter cd_BE

    (@cd_be)

    That code doesn’t seem to work. I added in the functions but nothing

    I don’t see that CSS code when I check your site. Did you add it to the functions.php file of your active theme?

    You can use a CSS plugin also, such as this AMP CSS plugin if you are not finding any luck editing functions.php. Just add the following CSS:
    .amp-wp-article-featured-image{display:none}

    • This reply was modified 5 years, 5 months ago by James Osborne.
    Thread Starter cd_BE

    (@cd_be)

    Yes, via Theme Editor

    The custom AMP CSS worked but not on all post?

    Correct: https://ambiance.be/alain-ducasse-verkoopt-meerderheidsbelang-in-koksschool/amp/

    Double: https://ambiance.be/leven-na-de-bocuse-piet-vande-casteele-gaat-zijn-eigen-weg/amp/

    • This reply was modified 5 years, 5 months ago by cd_BE.

    All looks good to me, I don’t see any duplicates. Nice work on the site.

    Thread Starter cd_BE

    (@cd_be)

    Thanks, it was a team effort.
    It was a cache problem, for the double pages.

    Still have some problems with pages loading (or not) and the menu doesn’t seem to work.

    With regards issues with pages loading there could be any number of reasons, check also that you don’t have an additional AMP plugin active. Looking at your homepage in AMP it looks like you might have a second AMP plugin installed.

    For the navigation menu you are using AMP in “Reader” mode, which provides a basic look and feel for your AMP pages. You can manually implement a navigation menu by the amp-sidebar component to your reader mode template.

    Thread Starter cd_BE

    (@cd_be)

    I have Better AMP and the AMP CSS.

    But if I understand you correctly I better disable the reader mode?

    We can only provide support for the official AMP plugin, but it could be a contributing factor to some AMP pages not loading. Having two AMP plugins could cause conflicts.

    Reader mode disregards your active theme, providing a basic AMP look and feel. Many users choose to add various AMP components to the AMP reader mode to create a mode feature rich AMP version of their site.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to disable future image in AMP posts?’ is closed to new replies.