It’s not uncommon for bloggers to put ads between paragraphs of their post. For experienced bloggers, adding in the Google AdSense code to your post isn’t a big deal, but what about someone who isn’t comfortable with any code?
A client of mine asked how they could embed their ads into the body of their posts, rather than the footer or sidebar like they had been. They didn’t feel comfortable working in code, and wanted a really simple solution.
It occurred to me that this could be accomplished with a really simple shortcode. Everything could be automated, and the blogger would just need to remember to enter a simple shortcode where they wanted their Ads to show up.
Add the following function to your theme’s
functions.php file. Replace the AdSense code with your own code so your add shows up.
Now, all the blogger has to do is use the new shortcode you created.
Credit for shortcode goes to WpRecipes.