Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mhs0

    (@mhs0)

    BTW, if anyone else wants to do this, you can add the following code to “accelerated-mobile-pages/templates/header.php” via the plugin editor. It will append “/?amp” to the end of every menu link:

    <div role=”button” tabindex=”0″ on=’tap:sidebar.close’ class=”close-nav”>X</div>

    <?php /* INSERT NEW CODE STARTING HERE */ ?>
    <?php function add_menu_atts( $atts, $item, $args ) {
    $atts[‘href’] .= “/?amp”;
    return $atts;
    }
    add_filter( ‘nav_menu_link_attributes’, ‘add_menu_atts’, 10, 3 );
    ?>
    <?php /* END OF NEW CODE */ ?>

    <?php wp_nav_menu( array( ‘theme_location’ => ‘amp-menu’ ) ); ?>

    Thread Starter mhs0

    (@mhs0)

    Thanks for your reply!

    Ok, got it. A future feature might be to auto-append /amp at the end of internal links.

    Thanks again!

    Thread Starter mhs0

    (@mhs0)

    Never mind, I figured it out – it was a template string mismatch, and I guess it defaults to the link.

    BTW, for those who are interested, separately I realized that offer_price and price don’t include sales price (SalesPrice), so I added it in at the top of the position string: array(‘Offers’,’Offer’,’OfferListing’,’SalePrice’,’FormattedPrice’)

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)