Some useful mini-plugins for WordPress
Originally for my own use, I put together a couple of WordPress plugins, which I thought I’d make available in case they were useful to anyone else.
Google AdSense shortcode
This is the simplest plugin, which provides an ‘adsense’ shortcode to output a Google ad. To use it, use Google’s tools to create the ad, then paste it into the php file where indicated, then put {adsense} (replace the curly braces with square brackets) in posts/pages where you want the ad to appear (remove the spaces around the square brackets).
And now for a demo + shameless attempt at monetization:
Media player
This one is useful if you occasionally post a video file on your blog, and host it locally. If you use video more frequently, there are plugins that probably are more suited, but I personally didn’t want the overhead, and I wanted to store videos in the standard upload locations, instead of having a separate repository, which seems to be what other plugins do.
This one uses the JW FLV player, provided in the plugin. Use something like:
{media source="http://my.site.com/path/to/video.flv" width="400" height="308" preview="http://my.site.com/path/to/preview.jpg"}
(replace the curly braces with square brackets)
I used this just the other day on a post demonstrating the output of the simulator I’ve written for my PhD.
Music player
This is the plugin that renders the content for my music page, as well as providing mini-players for other posts. Give it a path to a directory, and it will display all mp3 files in that directory with flash players based on the XSPF Web Music Player. Recently-added mp3 files will be marked as ‘New’. Use something like:
{musiclist path="path/to/my/music"}
(replace the curly braces with square brackets; add optional nolink=”true” parameter to avoid linking to the mp3 files from their titles)
For just one track, use:
{audio source="path/to/audio.mp3"}
Read More