Google Adsense Ads are a great way to earn money from your blog or site. Shortcodes are very useful to bloggers too and can be used to easily display an Adsense Ad that you created and setup in your Google Adsense Account. Just add this WordPress Code Snippet to the functions.php file in your current WordPress theme in order to make a custom Shortcode to display an Adsense Ad in WordPress.
/** * Create Adsense Ad Shortcode * * @author WPSnacks.com * @link https://www.wpsnacks.com */ function adsense_shortcode() { ?> Put_Adsense_Code_Here <?php } add_shortcode('Adsense', 'adsense_shortcode');
Be sure to replace Put_Adsense_Code_Here with your Adsense generated Ad code. Then just put [Adsense] anywhere in your content that you would like to display that Adsense Ad. Hope this helps, enjoy!
share market says
Nice tips. Hope this code works to display mobile ads too.
Neil Patt says
To avoid coding and edition you can use post layout plugin for WordPress to show adsense ads wherever you want.
keto says
Hi Guys, I’ve found this interesting! Check it out! http://www.empowernetwork.com/keto/ Lots of stuff about adsense
GeekSane says
nice post
greetings from Geeksane