This conditional tag examines the url of the current page and determines if the url ends in ‘ia.’ This allows for a custom page to be rendered using the standards for Facebook’s Instant Articles.
You will need to create an RSS Feed that meets Facebook’s requirements for Instant Articles.
<txp:aks_header name="Content-Type" value="application/rss+xml" strip="0" gzip="1" nodebug="1" /><?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><txp:site_name /></title>
<description><txp:site_slogan /> - instant articles feed</description>
<link><txp:link_to_home /></link>
<atom:link href="<txp:link_to_home /><txp:page_url type="s" />/" rel="self" type="application/rss+xml" />
<pubDate><txp:rah_function call="safe_strftime" str="rfc822" /></pubDate>
<txp:article_custom form="ia" section="article" />
</channel>
</rss>
<item>
<title><txp:title /></title>
<content:encoded>
<![CDATA[
<txp:body />
]]>
</description>
<guid><txp:permlink /></guid>
<description>
<txp:rah_function call="strip_tags">
<txp:body />
</txp:rah_function>
</description>
<link><txp:permlink />ia/</link>
<pubDate><txp:posted format="%a, %d %b %G %T %Z" /></pubDate>
<author><txp:author /></author>
</item>
You can see an example of the results: http://ampdemo.cmsstyles.com/ia/
You will want something similar to this in your individual article template to display the alternative formatting.
<txp:mkp_if_ia>
<txp:output_form form="layout_archives_ia" />
<txp:else />
<txp:output_form form="layout_archives_standard" />
</txp:_mkp_if_amp>
Version 1.0: May 10th, 2016