Proper placing of your ads is a really effective way to maximize the Google Adsense earnings. And many people supports and recommend to place ads inside or within the blog post. In this article I’m going to share to you how I easily show Adsense Ads anywhere inside the blog post by creating shortcode in WordPress.
I have created a shortcode [showads468×60] in my functions.php file which allows me to use that shortcode inside any blog post I make at any place. Wherever I place the shortcode [showads468×60] it will automatically show up the corresponding ad I have created for the same. Sounds cool..nah?
Ok then, lets get started. First of all you will have to create the shortcode and for that goto your edit your functions.php (Appearance>>Editor>>Theme Functions(functions.php)) and put the below code at the end of it. (* Keep a copy of your functions.php file before doing it, just in case 😉 )
Make sure you replace the term [YOUR ADSENSE AD CODE HERE] with the adcode you get from creating the ad in your adsense account. So finally you will have code like this:
That’s it..! Now you can use the shortcode [showads468×60] anywhere in your blog post and it will show up the adsense ad there. You can also further create separate short codes for each ad size like [showads320x240] or [showads250x250] in the similar way by replacing the shortcode tag name and adsense adcode. Hope you like it 🙂