mhs0
Forum Replies Created
-
Forum: Plugins
In reply to: [AMP for WP - Accelerated Mobile Pages] AMP Menu doesn’t link to AMP pagesBTW, 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’ ) ); ?>
Forum: Plugins
In reply to: [AMP for WP - Accelerated Mobile Pages] AMP Menu doesn’t link to AMP pagesThanks for your reply!
Ok, got it. A future feature might be to auto-append /amp at the end of internal links.
Thanks again!
Forum: Plugins
In reply to: [Amazon Link] Template is not working as expectedNever 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!