Today I’m gonna show how to Embed Google Adsense anywhere in your post, you can put your ad in anywhere in post like after the image, after a paragraph or in the middle of the post.
1. First you need add the following code in your function.php file of your theme
Don’t forget to Subscribe to Email Newsletter, Follow us on Twitter and Like us on Facebook – for recent updates.
function showads() { return '<script type="text/javascript"><!-- google_ad_client = "pub-2027406933994659"; /* 300x250 Sidebar */ google_ad_slot = "5310377007"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> '; } add_shortcode('adsense', 'showads');
Note: Don’t forget to change the adsense code otherwise it will display my ads on your own site.
2. Once you saved the functions.php file, you’re now able to embed your adsense code on your posts and display it exactly where you want.
To do so, simply paste the following code on the editor, in html mode of your post:
[adsense]
Do you know any other wordpress tip? Let us know
Don’t forget to Subscribe to Email Newsletter, Follow us on Twitter and Like us on Facebook – for recent updates.
0 comments