Thread Starter
yasuo
(@sanazlux)
my website aryarom.com
I want the following codes to be displayed in the Amp plugin
<?php $download_tag = get_the_term_list($post->ID,'download_tag','',' ','');
if (!empty($download_tag)) {?>
<hr>
<div class="pixel-tags">
<span><i class="fal fa-tags fa-lg uk-text-middle ml-small"></i>برچسب ها: </span>
<span><?php echo $download_tag; ?></span>
</div>
<?php } ?>
Hello @sanazlux
Thank you for contacting us, We checked your AMP page it seems you are using Reader More with a Legacy theme, the legacy theme has different templates and hooks, you can learn more about customizing a Legacy theme using our documentation
example code:
add_filter( 'amp_post_article_footer_meta', function ( $meta_parts ) {
$meta_parts[] = 'xyz-download-tags';
return $meta_parts;
} );
add_filter( 'amp_post_template_file', function ( $file, $type, $post ) {
if ( 'xyz-download-tags' === $type ) {
$file = dirname( __FILE__ ) . '/templates/xyz-download-tags.php';
}
return $file;
}, 10, 3 );
Now create the xyz-download-tags.php in the specified path in xyz-download-tags.php file use your code.
@sanazlux As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.