Forums

getting google adsense to work...help (6 posts)

  1. sheerrainbow
    Member
    Posted 3 years ago #

    I've been trying to add my adsense to work *without* a plug-in or widget in my sidebar - is it possible? If so, a little direction would be great. I've been at this for 2 hours, and it's driving my crazy. My theme isn't widget ready, and I don't know how to make it so...

  2. asechrest
    Member
    Posted 3 years ago #

    You can add the code directly into sidebar.php. I'd also consider getting a widgetized theme.

  3. Daynah
    Member
    Posted 3 years ago #

    If your website is not widget-ready, you can add the Google Adsense code in the theme itself.

    Just go to your Control Panel -> Appearance -> Editor
    (This will allow you to edit your current theme.)

    Now say you want to add a Google Adsense banner in the header.
    Find header.php on the right side and click on it.

    Now add your Google Adsense code anywhere after the <body> tag. Test it out to position it to where you want it to be.

    Other files you can add your Google Adsense code to are page.php, sidebar.php, footer.html, etc.

    Good luck!

  4. sheerrainbow
    Member
    Posted 3 years ago #

    Okay, just tried using the editor, and the ad still doesnt show. It says its unavailable.

  5. asechrest
    Member
    Posted 3 years ago #

    Did you just create the ad? It takes some time for the add sections to populate.

    Have a link to your site?

  6. sheerrainbow
    Member
    Posted 3 years ago #

    Hmm, well I just got it to work using this code:

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

    ....could be doing it wrong still, but I've been reading other websites saying that adsense will only work with a widget or plugin. I tried a widget, but the adsense didnt show up still, and the rest of my sidebar content disappeared >_<

    http://sheer-rainbow.net >> my website

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags