Most of the people using Google adsense on there blog website. To implement the google adsense on wordpress themes like sidebar.php we can use shortcode on the editor.

1.Open the functions.php file in your theme and paste the following code. Don’t forget to modify the JavaScript code with your own AdSense code!

function showads() {
return '<div id="adsense"><script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXX";
google_ad_slot = "4668915978";
google_ad_width = 468;
google_ad_height = 60;

<script type=”text/javascript”

add_shortcode(‘adsense’, ‘showads’);

2. Once you have saved functions.php, you can use the following shortcode to display AdSense anywhere on your posts and pages:
It’s very easy to implement google adsense any where of your post.