Adsense on one single post on wp?

by satrap
14 replies
  • SEO
  • |
Is there anyway to place adsens code on juts one page on wp blog? I know there are plugins that let you add adsense or you can do it by putting the code in singlepage.php. But it will be shown with evry post. But I am actually trying to add it to just one post. Is it possible?
Thank you in advance.
#adsense #post #single
  • Profile picture of the author TheSEOmo
    Is there a reason that you can not just switch to html view and add the individual instance of your adsense code to the post?
    {{ DiscussionBoard.errors[3117395].message }}
    • Profile picture of the author satrap
      Originally Posted by TheSEOmo View Post

      Is there a reason that you can not just switch to html view and add the individual instance of your adsense code to the post?

      Thanks for the reply. I thought it would work, but it didn't. I pasted the code using the html side but it wouldn't show up.
      I know ad sense takes a while sometimes to show up live and I waited ro 30 min or so, but it still wouldn't show up. It would be just one big old empty space.
      Since I am not very technical, I thought maybe something has changed and its not possible any more.

      I'll give it another try. Thanks again guys.
      Signature
      60 Awesome Ways to Make Money Without a Job
      .................................
      Check out my blog Survey Satrap featuring honest reviews of paid survey sites.
      {{ DiscussionBoard.errors[3123312].message }}
  • Profile picture of the author terryd
    Advertising manager will let you do that.....
    Signature

    {{ DiscussionBoard.errors[3117611].message }}
    • Profile picture of the author JoshuaG
      Is there a reason that you can not just switch to html view and add the individual instance of your adsense code to the post?
      This will work.
      Signature

      {{ DiscussionBoard.errors[3117813].message }}
  • Profile picture of the author craigcdz
    its good to have adsense in your wp. i have used it for my whole wordpress blog but never tried or heard for one single post. i think that would be much difficult. But search in Google you will get a clue.
    {{ DiscussionBoard.errors[3123401].message }}
  • Profile picture of the author yukon
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[3123414].message }}
    • Profile picture of the author aCass
      Originally Posted by yukon View Post

      You can tweak the <div> tag like:

      <div style="margin: 5px; float: left;">

      //Adsense Code Here//

      </div>
      Hey,

      I tried this and it's VERY close to the wrap around I was looking for, but for some reason it's disconfiguring the entire layout, as in it doesn't seem to fit.

      I'm using the Prosense Theme. I tried looking at where in the code I can lower the pixels or margin from the sidebar, but nowhere to be found.

      I also tried lowering the margin number u stated above, as well as making the ad itself smaller and it's still disconfigured.

      Any ideas?

      Thanks.
      {{ DiscussionBoard.errors[3159747].message }}
  • Profile picture of the author aCass
    Hey thanks, but it still messes up the layout, it pushed up the "no comments/edit post" to the side bar where the other wide skyscraper is and the color switches around.

    This is way it's supposed to look but I want the article wrapped around the ad:

    http://i54.tinypic.com/2ppgga8.jpg

    And this is how it looks with both codings you supplied, but the layout is all off:

    http://i52.tinypic.com/34fmyh0.jpg

    This happens with both left and right, and both html codes.

    The Theme is Prosense.

    Thanks a lot for your help.
    {{ DiscussionBoard.errors[3160203].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by aCass View Post

      Hey thanks, but it still messes up the layout,
      It does mess it up because if you have a "float"... you will need to "clear" it somewhere, otherwise EVERYTHING that comes after will float.

      But this at the very end of you post content (i.e. after the last sentence):
      <br style="clear:both;" />
      Signature

      {{ DiscussionBoard.errors[3162267].message }}
  • Profile picture of the author webtrix
    Here's a solution that I'm using some time now..:

    Firstly, when you're adding new post, create a new custom field, and add key "showad", with value of 1
    Then go to and edit your theme and add this code where you want your ad to be shown:

    <?php
    global $wpdb;
    $id = $post->ID;
    //get showad key
    $showad_z="showad";
    $showad_y = get_post_meta($post->ID, $showad_z, true);
    $showad = "$showad_y";
    // shall we show google ad ?
    if ($showad != '0'){
    ?>

    GOOGLE ADSENSE CODE

    <?php
    }
    ?>


    Not sure what I was doing with those variables, but something wasn't working as it supposed to.. so I left it like that, and it works for me.
    {{ DiscussionBoard.errors[3160279].message }}
  • Profile picture of the author aCass
    So you would add that code to a the Post or Single Post Templete?
    {{ DiscussionBoard.errors[3162104].message }}
  • Profile picture of the author aCass
    Thanks so much Iztvan and yukon. A combination of both's posts did the trick, I appreciate it.

    Cheers
    {{ DiscussionBoard.errors[3164174].message }}

Trending Topics