This conditional tag examines the url of the current page and determines if the url ends in ‘amp.’ This allows for a custom page to be rendered using the standards for Google’s Accelerated Mobile Pages Project.
Note: I deliberately wanted to keep this simple. If you are looking for additional features, I highly recommend checking out pat_if_amp, which started out as a fork but has added a number of additional featuress.
You will want some code similar to this in your individual article template header so that the amp page can be properly detected.
<txp:if_individual_article> <link rel="canonical" href="<txp:permlink />"> <link rel="amphtml" href="<txp:permlink />/amp/"> </txp:if_individual_article>
You will want something similar to this in your individual article template to display the alternative formatting.
<txp:mkp_if_amp> <txp:output_form form="layout_archives_amp" /> <txp:else /> <txp:output_form form="layout_archives_standard" /> </txp:_mkp_if_amp>
Version 1.0: March 24th, 2016