Hello @glamsham
Thank you for contacting us, As you mentioned in the previous support topic you are using the Newspaper theme by tagDiv, You can try adding auto-ads code in header using wp_head hook.
eg:
add_action( 'wp_head', function() {
?>
<amp-auto-ads type="adsense" data-ad-client="ca-pub-xxxxxxxxxxxxxxx">
</amp-auto-ads>
<?php
} );
You also use the Sitekit by Google plugin which integrates all goole services including auto ads in your AMP and non-AMP pages.
You can also try using this mini-plugin (to install follow the instructions in the comments)
We hope this helps!
Hi,
This is confusing me as the link indicates that the code is to be implemented in the body!
Hello @glamsham
Sorry about confusion, Please try using it on wp_body_open or amp_post_template_body_open and see if that works for you
add_action( 'wp_body_open', function() {
?>
<amp-auto-ads type="adsense" data-ad-client="ca-pub-xxxxxxxxxxxxxxx">
</amp-auto-ads>
<?php
} );
@glamsham 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.