Hi support,
i'm trying to implement an amp-list by using a shortcode.
for the moment i've taken the amp-list code from
https://ampbyexample.com/components/amp-list/
See test shortcode code
add_shortcode('amp_list', 'hor_amp_list');
function hor_amp_list($atts) {
try {
extract(shortcode_atts(array(
'src' => '/wp-json/amp/v2/request',
), $atts, 'hor_list'));
return '<h2>amp-list example</h2><amp-list width="auto"
height="400"
layout="fixed-height"
src="https://ampproject-b5f4c.firebaseapp.com/examples/data/amp-list-urls.json">
<template type="amp-mustache">
<div class="url-entry">
<a href="/{{url}}">{{title}}</a>
</div>
</template>
</amp-list>';
} catch (Exception $ex) {
return display_shortcode_error('Error in displaying hor_amp_list: ' . $ex->getMessage());
}
}
the result can be seen on http://spotler.test3.bluemammoth.nl/blog/amp
However i only see the h2 tag and the amp-list is stripped?
is amp-list supported?
Regards
Sivard
i'm trying to implement an amp-list by using a shortcode.
for the moment i've taken the amp-list code from
https://ampbyexample.com/components/amp-list/
See test shortcode code
add_shortcode('amp_list', 'hor_amp_list');
function hor_amp_list($atts) {
try {
extract(shortcode_atts(array(
'src' => '/wp-json/amp/v2/request',
), $atts, 'hor_list'));
return '<h2>amp-list example</h2><amp-list width="auto"
height="400"
layout="fixed-height"
src="https://ampproject-b5f4c.firebaseapp.com/examples/data/amp-list-urls.json">
<template type="amp-mustache">
<div class="url-entry">
<a href="/{{url}}">{{title}}</a>
</div>
</template>
</amp-list>';
} catch (Exception $ex) {
return display_shortcode_error('Error in displaying hor_amp_list: ' . $ex->getMessage());
}
}
the result can be seen on http://spotler.test3.bluemammoth.nl/blog/amp
However i only see the h2 tag and the amp-list is stripped?
is amp-list supported?
Regards
Sivard