How to put an image ad instead of ad sense on single post (single.php)?

by satrap
16 replies
On my blog right above the post content I have ad sense code displaying ads. But someone wanted to advertise on my blog and want to place the banner where the ad sense ads are currently displayed. He sent me the image which is 254 x 255 and the link it would pint to. But, I can't figure out how to get it there. I uploaded the image to my public_html/wp-content/themes/mytheme/images/. I thought I could do it using this code:

<a href="http://www.mylink">
<IMG SRC="http://www.myblog.com.com/public_html/wp-content/themes/mytheme/images/myad.png">
</a>
But its not working. When I load the page in firefox, For a second I can see the 254 x 255 box with no image, but when it loads, there is nothing there. Even the space where the ads supposed to show up, isn't there. Meaning the post content moved up a few lines.


Can anyone help me solve this mystery? I would appreciate any help.
I am hoping Istvan or Bill are around, I am sure you guys know what the problem is. Thank you all in advance.
#image #post #put #sense #single #singlephp
  • Profile picture of the author Darren Cottingham
    You might find it easier to upload it to your media gallery and grab the image's URL straight from there. Wordpress's image gallery will give you the direct URL to the image - then you can paste that in.
    {{ DiscussionBoard.errors[2669491].message }}
    • Profile picture of the author satrap
      Originally Posted by Darren Cottingham View Post

      You might find it easier to upload it to your media gallery and grab the image's URL straight from there. Wordpress's image gallery will give you the direct URL to the image - then you can paste that in.
      Thanks again for your suggestion. It turns out I was not entering the correct path to the image. I did as you suggested and now its working.

      However, I can not get the image to align to the left! I used the alignleft code, but it still shows on the right side! Any ideas?
      Thank you all for your help. I really appreciate it.
      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[2669799].message }}
      • Profile picture of the author petevamp
        Originally Posted by satrap View Post

        Thanks again for your suggestion. It turns out I was not entering the correct path to the image. I did as you suggested and now its working.

        However, I can not get the image to align to the left! I used the alignleft code, but it still shows on the right side! Any ideas?
        Thank you all for your help. I really appreciate it.
        What align code are you using exactly. Ar you using the align code that is added to the image or are you adding the align code to align the entire image. Example <left>image and link code</left> or are you using the align with in the image string it self. imageurl align="left"
        {{ DiscussionBoard.errors[2669871].message }}
  • Profile picture of the author petevamp
    Originally Posted by satrap View Post

    On my blog right above the post content I have ad sense code displaying ads. But someone wanted to advertise on my blog and want to place the banner where the ad sense ads are currently displayed. He sent me the image which is 254 x 255 and the link it would pint to. But, I can't figure out how to get it there. I uploaded the image to my public_html/wp-content/themes/mytheme/images/. I thought I could do it using this code:

    But its not working. When I load the page in firefox, For a second I can see the 254 x 255 box with no image, but when it loads, there is nothing there. Even the space where the ads supposed to show up, isn't there. Meaning the post content moved up a few lines.


    Can anyone help me solve this mystery? I would appreciate any help.
    I am hoping Istvan or Bill are around, I am sure you guys know what the problem is. Thank you all in advance.
    You might try the max blog press banner plugin I use this on my affiliate marketing site and it works rather well. If you made a deal on a certain ammount of impressions it tracs the impressions for you so once those impressions are done you can remove it and put back up your adsense code.
    {{ DiscussionBoard.errors[2669527].message }}
  • Profile picture of the author zulfnore
    It depends on your theme. How is the ad slot defined? is it a DIV? Plus how do you insert the AdSense code into place?
    {{ DiscussionBoard.errors[2669531].message }}
  • Profile picture of the author CDarklock
    Originally Posted by satrap View Post

    When I load the page in firefox, For a second I can see the 254 x 255 box with no image, but when it loads, there is nothing there. Even the space where the ads supposed to show up, isn't there. Meaning the post content moved up a few lines.
    Sorry if this is a stupid question, but...

    Are you running any sort of ad blocking plugin?
    Signature
    "The Golden Town is the Golden Town no longer. They have sold their pillars for brass and their temples for money, they have made coins out of their golden doors. It is become a dark town full of trouble, there is no ease in its streets, beauty has left it and the old songs are gone." - Lord Dunsany, The Messengers
    {{ DiscussionBoard.errors[2669602].message }}
    • Profile picture of the author satrap
      Originally Posted by Darren Cottingham View Post

      You might find it easier to upload it to your media gallery and grab the image's URL straight from there. Wordpress's image gallery will give you the direct URL to the image - then you can paste that in.
      Thanks for the suggestion. I will give it a try. Hopefully it will work.

      Originally Posted by petevamp View Post

      You might try the max blog press banner plugin I use this on my affiliate marketing site and it works rather well. If you made a deal on a certain ammount of impressions it tracs the impressions for you so once those impressions are done you can remove it and put back up your adsense code.
      I am trying to not use too many plug-ins on the blog, because obviously it slows down the load time, plus I kind of like learning these things as I go along, instead of just downloading a plugin and never figuring out how to actually perform the action. But, if nothing works, I guess I might have to. Thank you for the suggestion.

      Originally Posted by zulfnore View Post

      It depends on your theme. How is the ad slot defined? is it a DIV? Plus how do you insert the AdSense code into place?
      Yes, its a DIV. I simply insert the ad sense code between <DIV> </DIV>

      Originally Posted by CDarklock View Post

      Sorry if this is a stupid question, but...

      Are you running any sort of ad blocking plugin?
      No, not at all, its actually a good reminder, since we often over look the simplest of things. But, no I am not using any ad blocking plugin. Thanks for the heads up any way.
      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[2669750].message }}
  • Profile picture of the author zulfnore
    OK, you might want to call the image in the css and then hook the link (target URI) in the normal place where you'd place the AdSense code.
    {{ DiscussionBoard.errors[2670240].message }}
  • Profile picture of the author promo_guy
    You could always delete it from your post and just click the Media icon again and this time be sure to select "align right" (assuming you didn't before).

    If that doesn't work, then like zulfnore says, you can use CSS to align the image.

    Also, and this is not a major thing, but I'd avoid using all caps with your html, such as DIV or IMG SRC unless you're using html 4.0. If you have a new(ish) install of Worpdress then try to stick to xhtml standards or your site won't validate.

    Not a huge thing but I do think Google appreciates sites that use valid code. Anyway, just thought I'd mention it
    {{ DiscussionBoard.errors[2678275].message }}
    • Profile picture of the author satrap
      Originally Posted by petevamp View Post

      What align code are you using exactly. Ar you using the align code that is added to the image or are you adding the align code to align the entire image. Example <left>image and link code</left> or are you using the align with in the image string it self. imageurl align="left"
      Thank you for taking time to help out.
      I believe I am using the second one. Here is the exact code I am using:

      <a href="link.com" target="_blank"><img class="alignleft" title="link.com" src="link.com/wp-content/uploads/2010/09/ads.png" alt="link" width="254" height="255" /></a>
      </div>


      However, after reading your post here, I tried it the other way as well, but it still comes up to the right.




      Originally Posted by zulfnore View Post

      OK, you might want to call the image in the css and then hook the link (target URI) in the normal place where you'd place the AdSense code.
      Thanks for your help. I am not really familiar with css coding. I know a tiny bit. What code would I use and where in Css file should it be placed? Thank you.



      Originally Posted by promo_guy View Post

      You could always delete it from your post and just click the Media icon again and this time be sure to select "align right" (assuming you didn't before)....
      Thanks for your reply. But the image isn't in the post. Its above where the post content goes. So its in a totally different section (div or whatever its called).
      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[2688868].message }}
      • Profile picture of the author rosetrees
        Try adding this at the beginning <p style="text-align: center;"> before <a href =xxxxx

        with a closing </p> at the very end
        {{ DiscussionBoard.errors[2689311].message }}
  • Profile picture of the author Sheryl Polomka
    I usually use this code:

    <div style="border: none; margin: 3px; float: left;"></div>

    when I put an add in the single post, usually works well.
    Signature
    {{ DiscussionBoard.errors[2689329].message }}
    • Profile picture of the author satrap
      Originally Posted by rosetrees View Post

      Try adding this at the beginning <p style="text-align: center;"> before <a href =xxxxx

      with a closing </p> at the very end
      Originally Posted by Sheryl Polomka View Post

      I usually use this code:

      <div style="border: none; margin: 3px; float: left;"></div>

      when I put an add in the single post, usually works well.
      Thank you both. I tried both codes, but didn't work. Any other idea?...
      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[2702782].message }}
      • Profile picture of the author Lee Wilson
        Are you trying to wrap the content around the image? If so put this just after the opening <p>

        <div style="display:block;float:left;margin: 10px 5px 5px 10px;"><a href="yourlink" target="_blank"><img src="yourlink" /></a></div>


        If you want it to sit above the content then try this.

        <div style="clear:both;"></div>
        <div style="display:block;float:left;margin: 10px 5px 5px 10px;"><a href="yourlink" target="_blank"><img src="yourlink" /></a></div>
        {{ DiscussionBoard.errors[2703210].message }}
  • Profile picture of the author Owen Smith
    Send me your login details and I will do this for you and send you the results of how I did this.
    Signature

    All the Hottest eBooks, Graphics, Software, Videos, Articles, and Templates you want with PLR and MRR. Join PLR Assassin Today!

    {{ DiscussionBoard.errors[2703223].message }}
  • Profile picture of the author thebitbotdotcom
    For starters, you have two .com's in the path...http : // www . myblog . com . com

    Try adding a new folder to your root domain like this:

    public_html/images/

    and then upload your image there. Then change your code to:

    <a href="http://www.mylink">
    <img src="http://www.myblog.com.com/images/myad.png">
    </a>

    That is how I do it. Maybe it is possible that the permission settings of one of the folders in your string is not allowing it through.
    Signature
    Do Your Copywriting Skills Suck?

    Let Us Help You Develop Your Writing Skills!

    Submit Guest Posts With [ TheBitBot.Com ]
    {{ DiscussionBoard.errors[2703235].message }}

Trending Topics