Embed Google Adsense anywhere in your post


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.

Embed Google Adsense anywhere in your post
Just follow the below steps:
1. First you need add the following code in your function.php file of your theme
Don’t forget to Embed Google Adsense anywhere in your post Subscribe to Email NewsletterEmbed Google Adsense anywhere in your post Follow us on Twitter and Embed Google Adsense anywhere in your post 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 Embed Google Adsense anywhere in your post Subscribe to Email NewsletterEmbed Google Adsense anywhere in your post Follow us on Twitter and Embed Google Adsense anywhere in your post Like us on Facebook – for recent updates.
Tags:

0 comments

About Me

Ashok Rathod
I am an enthusiasts web designer who love creativity and enjoys experimenting with various techniques in web development. In my free time you'll find me exploring new web technologies, developing cool websites. You can follow me on twitter.