WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. KosherShopaholic
    Member
    Posted 2 years 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. You don't need a plugin. I'm assuming you're putting the google code in a text widget?

  3. KosherShopaholic
    Member
    Posted 2 years 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. This is a widget or are you putting the code manually into your posts?

  5. KosherShopaholic
    Member
    Posted 2 years ago #

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

  6. 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 2 years ago #

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

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

  9. KosherShopaholic
    Member
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic