Adsense for Wordpress - my version!

| | Comments (19) | TrackBacks (1)
Like a lot of bloggers I use adsense. Up until recently I was using a standard banner at the top of all pages, which was done by using an include in the template files. Other people seemed to have gone to some trouble to incorporate adsense in their posts, so I thought I'd investigate further.
The original adsense plugin for wordpress isn't fully compatible with wordpress 1.5, but Liew released a compatible version. Neither version was capable of placing the code inline so that your post "wrapped" it ie. in the middle of the text, so a bit more digging pulled up another version. It wasn't compatible with Wordpress 1.5 either, so I merged the changes from Liew into the Maxpower version. You can see the result in this post. If you would like a copy of my version of the plugin please feel free to download it here Installing it is very simple.
  1. Download the plugin
  2. Open it in a text editor
  3. Change the adsense code to use your adsense id
  4. Upload it into your plugins directory
    1. You should now activate it via the plugins manager in your admin panel. If everything is installed correctly you will now see an extra button in the editing window labelled "adsense code" If you want to edit the position, colours or other attributes, simply open the plugin file in a text editor and make your changes. Thanks to the other plugin developers :)
digg| bookmark

1 TrackBacks

Listed below are links to blogs that reference this entry: Adsense for Wordpress - my version!.

TrackBack URL for this entry: http://www.mneylon.com/cgi-bin/mt/mt-tb.cgi/1004

» from Adsense Deluxe Plugin Released

19 Comments

Wayne said:

I've expanded the inline adsense plugin for WordPress. My version (http://www.acmetech.com/blog/adsense-deluxe/) uses an options panel within your WP admin and allows you to define any number of ad styles and reference them in posts by names, change which style to use as default, globally/selectively enable/disable ads (w/out having to disable the plugin), and includes an AdSense Sandbox tool to preview the ads Google would display for a given web page.
cheers,
-wayne

blacknight said:

Wayne

I'll definitely be giving your version a try. It sounds like you've added a lot of very useful options to it.
Does your version cater for inline ads (as above) ?

Michele

Wayne said:

Yeah, I think so (if I understand what you mean). If you are/were using Phil Hord's adsense plugin, then mine simply builds upon that one. I started with his and immediately went crazy adding features. With phil's plugin, you would add the html comment in your post where you wanted your ads to appear. Mine works exactly like that except if you simply use that placeholder, you get the ad style which you have designated as your "default" style. Amongh all the ad styles you configure, you can easily change which one is "default" and all the ads in all the posts which are refenced with change. However, each style is defined with a unique name, so you can also reference the styles with something like . This makes it trivial to use different ad styles within a single post.
-w

blacknight said:

Wayne

I'll download it and see how it works

Michele

blacknight said:

Wayne

It doesn't have the inline CSS builtin, but it can easily be added :)

I activated the plugin on http://www.searchenginecookbook.com and placed the following CSS and HTML around the Adsense block:

ADSENSE

blacknight said:

Damn :(
I can't get the CSS to display in comments!!

Wayne said:

Michele,

show me an example of what you're trying to do. Just show me a snippet of the inline css and a portion of the adsense code (you'll want to escape the javascript stuff, or otherwise upt it in here so that it doesn't actually pull ads into the comment).

Alternately, email me a sample, you have my email address in my user registration.
-w

blacknight said:

Wayne

I've put the CSS in text file which you can get from:
http://www.mneylon.com/blog/go.php?http://www.mneylon.com/blog/wp-content/adsensestyle.txt

Michele

Wayne said:

I tried wrapping one of my ads in your style code. Since the adsense-deluxe plugin simply replaces the html comment with WHATEVER you define in the options admin, the style info was added to the web page when I reloaded it.

However... I noticed a bit of a problem in that wrapping the javascript with a styled tag resulted in a netsted paragraph since in my installation of WP it seems to be auto wrapping my content in tags. To wit:

(this is what came out in the html...)


...


so two points:
1) you shouldn't have any problem adding style info (or anything else you want) within the adsense block definitions and having that substituted into the posts. If that's not happening for you, let me know since it worked on my setup.

2) It might be more appropriate to use the tag instead of the paragraph.

Wayne said:

well, that didn't work. my pasted html sample was stripped or isn't rendering. Let me just use alternate tags... in my web page after adding your styled [p] wrapper, I got:

[p][p style="blah blah"]
[script ... adsense script here]
[/p]
..... my initial paragraph of content....
[/p]

blacknight said:

Wayne

HTML doesn't work in comments :)

You might want to have a look at my post:

http://www.mneylon.com/blog/archives/2005/07/28/adsense-deluxe-plugin-released/

as I've raised an issue you may not be aware of

Michele

AFAIK this is against AdSense TOS. Because currently AdSense prohibits you from including AdSense code in feeds(unless they have selected you for their AdSense for feed trial). If this plugin is used and you provide full feed to your users then you are essentially including AdSense Ad in feeds also.

blacknight said:

Angsuman

No ads appear in the feed for this site.

Michele

Wayne said:

And Michele, are you doing "full feeds"?

I guess I'll have to investigate that as well... but if you are doing full feeds and no ads are getting inserted, then it's most likely because I'm not registered as a feed filter.

I'll have to investigate this some more.

blacknight said:

Wayne

I do offer "full feeds" but, as I run it through feedburner, adsense does not display.

Michele

Wayne said:

The ads WERE making it into the feeds ( Yikes! ) but this has been fixed in v0.3.

-wayne

blacknight said:

Damn!
I'll have to upgrade even more plugins ! :(

Loren said:

Michele,

I'm trying your plugin but it is only working on my index page and not individual posts.

Any changes to be made for ad to appear in posts?

michele said:

Loren

It *should* just work :)

Have you tried Wayne's plugin?

Michele

Michele Neylon - cartoon picture

About this Entry

This page contains a single entry by Michele Neylon published on July 23, 2005 2:13 PM.

New Feedburner plugin was the previous entry on this site.

Creative Commons enabling your blog is the next entry on this site.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.1