Adding AdSense Auto Ad code
-
How to add Adsense auto ads code in amp version. I am using the Reader Theme AMP Legacy option in this plugin. But not able to find the auto ads adding option.
-
Hi Rajdeep,
In order to implement AdSense Auto ads for AMP code on your site have you tried the Site Kit plugin? Activating the AdSense module within Site Kit and allowing the plugin to insert your AdSense code will result in Auto ads code on both your AMP and non AMP URLs.
If you prefer to insert Auto ads code on your AMP legacy reader theme only, and not on your canonical (non AMP) URLs you can use this mini plugin.
Let me know if you have any further questions on the above.
-
This reply was modified 4 years, 10 months ago by
James Osborne.
I’m not using Sitekit Plugin, any other way?
I found this very useful and I managed to add google auto ads in my website
https://websiteforstudents.com/how-to-add-google-adsense-ads-on-wordpress-amp-pages/
@linuxrajdeep You can use this mini plugin if you prefer to not use Site Kit, with installation steps included within the Gist.
Done. Thanks.
No problem! Best of luck with your site.
@jamesosborne share the all mini plugins list page url.
Hi Rajdeep,
You’ll find that page below, on the plugin website:
https://amp-wp.org/documentation/getting-started/extending-amp-compatibility-extensions-and-mini-plugins/Thanks @jamesosborne
One more help needed. How to hide this favicon?
https://ibb.co/wsPTmdZHi Rajdeep,
You’ll find instructions on how to remove that programmatically below:
https://amp-wp.org/documentation/playbooks/classic-templates/#site-iconYou’ll need to include that code snippet within a custom plugin or your active themes functions.php file – preferably using a child theme so it doesn’t get overwritten.
You could also modify the associated AMP template or use remove the icon using some CSS styling. An alternative is to chose a different theme for your AMP URLs, such as one of the confirmed AMP compatible themes.
If you need any assistance with the above let me know.
Can’t figure out the exact PHP function code which can hide this favicon from the AMP template.
Using the AMP Legacy: Reader Theme option.Can you share the exact code which will work?
Or I have found this code. Should I use this?
-
This reply was modified 4 years, 10 months ago by
RAJDEEP DAS.
Thanks for the update. You could indeed use a CSS based solution, similar to that which you’ve already shared. The below is an example of a working snippet – which must be added to your active themes functions.php or preferably a custom plugin or custom functions plugin.
add_action( 'amp_post_template_css', function() { ?> /* Put Custom CSS below */ .amp-wp-header .amp-wp-site-icon { display: none; } <?php } ); -
This reply was modified 4 years, 10 months ago by
The topic ‘Adding AdSense Auto Ad code’ is closed to new replies.