Forum Moderators: martinibuster

Message Too Old, No Replies

WordPress and AdSense

         

Hugene

8:54 pm on Oct 14, 2006 (gmt 0)

10+ Year Member



Hello,

Is anyone integrating AdSense in a WordPress powered blog?

I managed to put the AdSense code in the header (just modified the header template file).

However, I put the AdSense code in a post entry, and it doesn't get displayed. I suspect that WordPress is striping something off the adsense code in the post, is that possible?

Hugene

9:09 pm on Oct 14, 2006 (gmt 0)

10+ Year Member



I was right: I just noticed that instead of

<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

WordPress displays only

<script type="text/javascript">
</script>

in the post entries. Anyone knows how to fix this issue?

Thanks

encyclo

9:11 pm on Oct 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does AdSense show on any site for you? This looks more like the work of an adblocking program such as Norton Internet Security.

david_uk

9:19 pm on Oct 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It may be that if there are several posts per page, and if adsense is on each page that you are exceeding the number of adblocks allowed on a page, hence no ads being served.

I use wordpress on my blog and adsense works fine.

Hugene

9:29 pm on Oct 14, 2006 (gmt 0)

10+ Year Member



There is only one AdSense Link block on that page, and this add code is only in one post entry, not in all of them, so I am not exceding the max number of adsense blocks.

My adsense code does get display on my other site perfectly.

I just discovered that there is an option in WordPress that automatically corrects invalidly nested XHTML automatically, but I unchecked that option and the problem is still there.

Any other ideas?

Hugene

9:47 pm on Oct 14, 2006 (gmt 0)

10+ Year Member



Ok, when I go directly in the DB with phpMyAdmin I can add the adsense code inside a specif post text.

However, now, at the end of every line of the AdSense code, a < br /> is added, which breaks the code.

Anyone knows how to deactivate the automatic adding of < br /> at the end of lines in WordPress?

Still, there is got to be beter ways than going straight in the DB tables.

Thanks

MartinSCC

10:24 pm on Oct 14, 2006 (gmt 0)

10+ Year Member



There are add-ons that will let you do that. Search for wordpress adsense plugins.

GiveMeMore

11:32 pm on Oct 14, 2006 (gmt 0)

10+ Year Member



if no adds are showing up it might be simply because google has no Ads for u yet, I've been using wordpress and adsense for the past 1.5 months with no problem

paul2yall

4:04 am on Oct 15, 2006 (gmt 0)

10+ Year Member



You need to install the Adsense-Deluxe plugin. It's the easiest way to place Adsense into your Wordpress posts. You can find it easily by doing a Google search. Works like a charm.

zoggle

11:33 am on Oct 15, 2006 (gmt 0)

10+ Year Member



Ok, when I go directly in the DB with phpMyAdmin I can add the adsense code inside a specif post text.

You are placing the Adsense code as a "comment", right? This won't work, as Wordpress automatically parses and formats your entries!

You have to modify the theme files - index.php if you want to insert Adsense code after the first post, or after the last post, or anywhere else on the page with conditional if-else.

Google "wordpress adding adsense" and you will find instructions on how to do these, that is, if you're comfortable messing up the PHP codes ;-)