Adsense inside Text

humanseed

Junior Member
Joined
Feb 10, 2010
Messages
141
Reaction score
72
I think this may be in the wrong section, but I posted it here, because I think alot of you already do this, as do I, but I just cant get it right on a theme I'm using.

Normally I just edit index.php, and add

PHP:
<div style="float: left; margin: 3px;">
<script type="text/javascript"><!--
google_ad_client = "pub-xxx";
/* 336x280, created 2/4/10 */
google_ad_slot = "xxx";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>


but this theme I'm working with doesnt seem to like it at all.

It just spaces it out as if I were to add "<p>" above and below the adsense code.

Now...I was messing with my index.php file of my theme...and no matter what I try, it does the same thing UNTIL, i removed the line:

PHP:
<div class="postmetadata">

Then my adsense code is in the text, just like I wanted. (Text around Ad) but then the whole theme gets screwed up.

I even tried adding the adsense delux plugin, but it did the same thing.

Anyone ever run into a theme, they really liked, but wouldnt work well with adsense.

Any help would greatly be appreciated.
 
<div style='float:right;'>
<p style="margin:0px">

<script type="text/javascript"><!--
google_ad_client = "pub-000000000000000000";
google_ad_slot = "00000000000000";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</p>
</div>
 
Thanks for the quick reply but its doing the same thing it's been doing to me for the past 3 hours.

:(
 
sorry bro, I am no expert on this thing..
This code I am using for my site..
Thanks..
 
It has something to do with the theme.

Like I said, I've tried everything I can think of, and it just wont work, and AS SOON as I remove that one line of code, it works, but then the theme gets all screwed up.

lol.
 
Sorry to doublepost...

But I got it. WOOT!

It had to do with the open <div> tag, once I deleted the line. i just had to figure out where to close it.

EDIT:: ALMOST got it. Everything is just aligned to the left now. Just needs moved over a bit, so the text is not right to the edge of the screen.
 
Last edited:
<div style="float:left;margin:3px">

----your script here---

</div>

don't forget to close your div with "</div>"
 
haha. It wasnt THAT one. lol.

It was some other one. Just gotta work on it a bit more, and should be good to go.
 
Back
Top