WordPress.org

Ready to get started?Download WordPress

Forums

How to add Google Adsense code to my site (16 posts)

  1. Echristian
    Member
    Posted 6 years ago #

    Hello

    I would like to add google adsense code to my wordpress blog http://www.christianedwin.com.

    How do i go about it?

  2. mores
    Member
    Posted 6 years ago #

    Depends on where you want it ... probably under the navigation, then open the sidebar.php file of your theme and paste google adsense code in there.
    Or if you want it near the bottom of the page, open footer.php.

  3. jimbishop
    Member
    Posted 6 years ago #

    Thanks mate just what i needed to know as a newbie

  4. Echristian
    Member
    Posted 6 years ago #

    Hello Mores,

    Many thanks for the info. Please can you give me a detailed step on how to Paste the Google Ad codes on my site? Please....

  5. mores
    Member
    Posted 6 years ago #

    You have your google adsense code. It usually looks like this

    <script type="text/javascript"><!--
    				google_ad_client = "pub-lotsofnumbers";
    				/* somenameyoudefined */
    				google_ad_slot = "somenumber";
    				google_ad_width = 300;
    				google_ad_height = 250;
    				//-->
    				</script>
    				<script type="text/javascript"
    				src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    			</script>

    Now open your sidebar.php. I suggest you right-click it, then use "open with" and select "notepad", in case you have no special HTML editor. Notepad is fine enough.

    In your sidebar.php you'll see some kind of code like wp_list_categories(). After that you'll find a <div class="line"></div> and right after that < br >< /div>.
    There should be a last < / div> left over, and right before this div, paste your google ad code. Save, then upload to your theme directory.

    This is just guessing, since I don't know the actual code of your sidebar.php file.

  6. Echristian
    Member
    Posted 6 years ago #

    Hello Mores,

    I'm really sorry if am asking too much questions. I do really understand your explanations. Please where do i go to do the pasting of the Google Adsense. Is it via my WordPress Admin Area or my Web host Company Admin area?

    Please help me out.

    Thanks a million times. If you dont mind i will also like to know more about you. You've been good to me.

    Many Thanks

  7. TheDiamondBuyingGuide
    Member
    Posted 6 years ago #

    You can do both techniques. I personally think it's easier via the WordPress admin area then you go in design, theme editor.. and then click on sidebar.php ... locate where you want to have your ads and then paste it there and save the changes. That works like a charm

  8. Echristian
    Member
    Posted 6 years ago #

    Hello DiamondBuyingGuide,

    Many thanks for the explanations. I will do as you've said.

    Thanks

  9. mores
    Member
    Posted 6 years ago #

    That'll only work if your server supports overwriting of files.

    I'm talking about opening the respective files on your desktop computer with NOTEPAD or some other basic editor, editing the contents, then uploading the file to your wordpress theme directory on your server.

    Try DiamondBuyingGuide's instructions first ... maybe your server supports this and you don't have to do all the editing/ftp stuff.

  10. Echristian
    Member
    Posted 6 years ago #

    Hello Mores and DiamondBuyingGuide,

    Many Thanks i have done it. Take a look by clicking HERE

    I'm really grateful. God bless the two of you.

  11. riteshshrvstv
    Member
    Posted 5 years ago #

    I want to ads from Google Adsense on my site Then I placed the script on side bar

    <script type="text/javascript"><!--
    google_ad_client = "pub-lotsofnumbers";
    /* somenameyoudefined */
    google_ad_slot = "somenumber";
    google_ad_width = 300;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    but google ads not display on my site . error message display "The page cannot be found" so How can I get these google adsense ads ?

  12. cftygv
    Member
    Posted 5 years ago #

    it does nor workk for me also

    מסחר במטח

  13. janeboha
    Member
    Posted 5 years ago #

    I'm also having trouble doing this. I've tried all the plugins and I'm using the dkrat theme and it's not working with their widgets, so I'm trying to add the code. Still nothing seems to be working. I used the new revised Google code, pasted the code in the sidebar.php after the last < / div > and the code is there but the ads don't show up. Not sure what's going on.

    The last lines of the sidebar.php code are:

    </div>

    <script type="text/javascript"><!--
    google_ad_client = "pub-6050244628764364";
    /* 120x600, created 8/1/08 */
    google_ad_slot = "0315850642";
    google_ad_width = 120;
    google_ad_height = 600;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    <?php } ?>

  14. janeboha
    Member
    Posted 5 years ago #

    I'm going to answer my own question. Now it's working. I got new code from Google - again. I inserted it in the Dkrat "text" widget and slid it into the "primary sidebar". I gave it a title just temporarily so I could see if it was in the right place. Then I waited - a while. The AdSense appeared and then I deleted the title. Not sure why it wasn't working before but persistence - and the old "try try again" plus some patience paid off!

  15. digitalartempire
    Member
    Posted 5 years ago #

    you have to wait ten mins for adds sense to work after codeing it

  16. 8web
    Member
    Posted 5 years ago #

    Hi -- I recently picked up a copy of a program called Google Adsense Widget for WordPress -- am I'm trying to install it but not having any luck.

    I've contacted the software creator but no reply from them.

    The widget partially loads onto my blog page but won't complete the install etc. The instructions indicated a need to enter my Google Publisher number but I cannot see/find any place in the control panels to do so ... any ideas?

    Thanks --
    Frank

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.