Forum Moderators: martinibuster
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?
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?
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
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 ;-)