Forums

[resolved] Code Bug when I enter Google AdSenes onto page (9 posts)

  1. KosherShopaholic
    Member
    Posted 9 months ago #

    When I enter the code to run a google ad into HTML I get this garbage showing up in my home screen, '// // // ]]>'

    How do I get rid of it????
    Is there a plug-in for Google Ads to run before content. I have a widget to run google Ads after content.
    I am using StudioPress News Theme

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    You don't need a plugin. I'm assuming you're putting the google code in a text widget?

  3. KosherShopaholic
    Member
    Posted 9 months ago #

    Yes, I'm putting it in a text widget but it there's a problem - it places garbage symbols in my post on the home page. See my website to see what's happening:
    http://www.koshershopaholic.com
    How do I get rid of that?????

  4. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    This is a widget or are you putting the code manually into your posts?

  5. KosherShopaholic
    Member
    Posted 9 months ago #

    I'm putting it manually into the post under HTML mode.

  6. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    Okay, then the problem is that the code is being picked up by the excerpt grabbing :)

    if you create custom excerpts, those would be used instead and would obviate the issue. If that's not doable, then you should edit your theme to have the ads in your single.php file, outside of the content of your post.

  7. KosherShopaholic
    Member
    Posted 9 months ago #

    Okay, so how do I do that? single.php file? Thank you.

  8. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 9 months ago #

    You edit the file in your theme, single.php, and put the ad where you want it to show up.

  9. KosherShopaholic
    Member
    Posted 9 months ago #

    That answer was a bit too technical for me but I fixed it by putting the code in a simple hook. Thanks for your support and help, though.

Reply

You must log in to post.

About this Topic