AdSense Secondary Domain
Friday, October 20, 2017
Sunday, October 1, 2017
Monday, September 18, 2017
Thursday, September 14, 2017
How to add amp-auto-ads code to Wordpress site which uses "AMP for WP"
I've installed "AMP for WP" after Google started punishing it in search results for not having Accelerated Mobile Pages some time ago. And have been playing with it for some times now. The plugin itself is very nice and gives an easy way to set up pages and customize them a bit.
However there doesn't seem to be an easy way to add custom code to the page content itself. There is a way to add code between "<head></head>" tags or to the footer, but there is no such way to do it within "<body></body>" tags. And this is where customized Adsense codes should go if you wish to use some (including responsive ads by the way).
I did get away with using standard plugin way of adding adsense (non-responsive) for a while. However I had to figure alternative way of dealing with this problem today since I've got an invitation to "Accelerated Mobile Pages (AMP) Auto Ads" google labs for my cooking website, enabling of which requires to add some custom code to the AMP page content right after the "<body>" tag.
After few tries to search through forums, FAQs, and websites, this is the solution which I came up with (use it on your own risk, plugin documentation didn't have this hook listed and I had to do some code reviews to find it, so it may not work entirely the way I think, or may stop working in future).
I've hooked into 'ampforwp_body_beginning' (added the following to the functions.php of my theme, replace angled brackets with proper characters and appropriate code in the adsense ca-pub value should you choose to copy/paste the code):
function amp_ads_insert() {
echo '<amp-auto-ads data-ad-client="ca-pub-YOUR-CODE-HERE" type="adsense"></amp-auto-ads>';
}
add_action( 'ampforwp_body_beginning', 'amp_ads_insert', 0);
Wednesday, September 13, 2017
Monday, July 31, 2017
Chilling Out
Sunday, April 30, 2017
Tuesday, April 18, 2017
Sunday, April 16, 2017
Friday, April 14, 2017
Wednesday, April 12, 2017
Tuesday, April 11, 2017
Saturday, April 8, 2017
Friday, March 31, 2017
Thursday, March 23, 2017
Friday, March 17, 2017
Sunday, March 12, 2017
Spring is Coming
With weather jumping back and forward between 65F and 30F for weeks now, these guys decided it is time for Spring to come... I am not blaming them:
Wednesday, March 8, 2017
Stalone and Painter
Monday, February 27, 2017
Saturday, February 4, 2017
Friday, February 3, 2017
Friday, January 20, 2017
Wednesday, January 18, 2017
Saturday, January 14, 2017
Once a Kitten is Always a Kitten
I've managed to get one more video for Painter together... Isn't he cute?
Saturday, January 7, 2017
Thursday, January 5, 2017
Sunday, January 1, 2017
Meet Cubic
He is visiting us for some time, but I somehow never introduced him here:
He is wishing everybody Happy Holidays and Happy New Year!