Optimanova
Forum Replies Created
-
Hi @nancy10199,
Thanks for your reply,
I have deactivated all plugins except AMP and I have the same problem,
Any idea about the different problems (Homepage, Menu)?
Thanks in advance,
Miguel
Hi,
Yes, I have had the same problem,
To fix this, you need go to Appearance -> Menus and select your main menu. After, you need to have a scroll down and select the checkbox AMP Menu,
Cheers,
Forum: Plugins
In reply to: [AMP for WP - Accelerated Mobile Pages] Front Page issueHi Ahmed,
Yes, It’s a cache problem, I have refreshed the cache and now you can see the rel=”amphtml” twice in the source code.
view-source:https://www.optimanova.com/
On the other hand, for your information, in the front page I have another issues with the AMP Validator. In this case, if you check the file:
accelerated-mobile-pages/templates/frontpage.php
It generates the whole content and It does not replace the invalid html tags, for example (<img, <iframe) and attributes (style=””, etc):
<?php the_content(); ?>
In this case, I have created a patch for our homepage and it works perfectly:
You only need to replace the last line with this:
<?php # Replace attributes style $content = preg_replace('/(<[^>]+) style=".*?"/i', '$1', do_shortcode(get_the_content()) ); # Replace img with amp-img tag $html = str_ireplace( '<img', '<amp-img', $content ); # Add closing tags to amp-img $html = preg_replace('/<amp-img(.*?)>/', '<amp-img$1></amp-img>', $html); # Replace iframe tags with amp-iframe $html = str_replace("iframe", "amp-iframe", $html); echo $html; ?>
In this case, I have deleted styles attributes and I have replaced img and iframe tags,
I hope this info can be useful for future updates,
However, there are still several html tags that need replacing, e.g. video, etc.
Thanking you in advance for your assistance,
Kind regards
Forum: Plugins
In reply to: [AMP for WP - Accelerated Mobile Pages] Front Page issueHi @ahmedkaludi,
Thanks so much, for the new update ??
I have a new issue in the front page, in this case, I have enabled the Custom Front Page Option and if you check the home page (desktop version) this tag appears twice:
<link rel=”amphtml” href=”https://www.optimanova.com/es/?amp” />
<link rel=”amphtml” href=”https://www.optimanova.com/es/amp/” />I have updated the permalinks and I have the same problem,
Thanking you in advance for your assistance,
Kind regards