Viewing 3 replies - 1 through 3 (of 3 total)
  • I am interested too

    Hi, menu with amp links have no sense because at this time amp is only for posts. Best what you can do is connection between pages.

    You can do this using:

    prev:

    <a href="<?php echo get_permalink(get_adjacent_post(false,'',false)); ?>/amp" class="left">
    <?php $url = wp_get_attachment_image_src( get_post_thumbnail_id(get_adjacent_post(false,'',false)), '50x50' );
    echo '<amp-img src="'.$url[0].$url[1].$url[2].'" alt="Tania strona internetowa"  width="50" height="50"></amp-img> '; ?>
    <span><?php echo get_the_title( get_adjacent_post(false,'',false) ); ?> </span></a>

    next:

    <a href="<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>/amp" class="right">
    <?php $url = wp_get_attachment_image_src( get_post_thumbnail_id(get_adjacent_post(false,'',true)), '50x50' );
    echo '<amp-img src="'.$url[0].$url[1].$url[2].'" alt="Tania strona internetowa"  width="50" height="50"></amp-img> '; ?>
    <span><?php echo get_the_title( get_adjacent_post(false,'',true) ); ?> </span></a>

    Working demo: https://apjoo.com/portfolio/renovate-2/amp

    with menus, it won’t be the same since most menus are JS and AMP was created to do away with that since it slows pageload time down.

    If you have a Related Posts type plugin that will add the similar articles to your article so you’ve got that. I’ve also found that on AMP our Tags are showing up as links at the head of the article so at least there’s pathways back to our site since these articles are actually being served off of Google’s servers, not ours.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add WP menu?’ is closed to new replies.