How to put Adsense Ads within the Content of a WordPress Blog

You cannot easily put your adsense codes inside the content of a post in your WordPress Blogs. This snippet will make a shortcode available to you. All you need to do is to paste that shortcode in write post area to include your Adsense ad.

PHP

Make an adsense shortcode and put your ads anywhere inside the content easily. Out the below code in functions.php and use [ads1] shortcode in your Post to get your ad placed there. Details in the source link.

 function the_adsense($atts) {
 return ' <div class="post-link-ad"> Put Your Adsense Code Here </div>'; } add_shortcode('ads1', 'the_adsense'); 

Share the love

Leave a Comment

Please keep in mind that comments are moderated and rel="nofollow" is in use. You can use [code][/code] if you want to write codes. Don't spam us :) Thanks!

Advertisement