How to Insert Google Adsense Anywhere in Your Blog Post
Creating a shortcode
You need to add the following code into your functions.php file. You can do this in your dashboard, just go to ‘Appearance’ => ‘Editor’ open your functions.php file. Scroll-down to the end of this file and add this code in new line:
1
2
3
4
|
function adsenseads() { return '<div id="adsenseads">Put your Google Adsense banner code here</div>' ; } add_shortcode( 'showmyads' , 'adsenseads' ); |
Save your changes.
Showing Adsense ads anywhere in your posts
Now you can use this shortcode to insert Adsense into your post, just choose the place in your test and write the following code:[showmyads]
You can use this WordPress shortcode in posts and pages.
ليست هناك تعليقات:
إرسال تعليق