WordPress – Christopher Murtagh https://philoxopher.com Ponderer, feminist, musician and dad. Sun, 10 Aug 2025 21:44:24 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 SimpleRSSEmbed – my first WordPress plugin https://philoxopher.com/2011/12/12/simplerssembed-my-first-plugin/ Mon, 12 Dec 2011 09:49:41 +0000 http://christopher.murtagh.name/?p=137 Ok, I’ve been doing all sorts of things with WordPress for a while now, but oddly enough, I never actually wrote a plugin (although, in retrospect, I did a lot of template hacks that probably would have been easier to do as plugins). Anyway, I needed a plugin for a blog I was working on that would allow me to display the summary of N number of blog posts from another blog. There seem to be plenty of existing plugins that do this, however most of them are either horrible code (both HTML and PHP), or they don’t work with Atom feeds that don’t have descriptions. I wanted something very simple, with very clean output that would ‘just work’™. So, after trying about a dozen of them, I decided to just write my own (which turned out to be insanely easy). If I would have started down that path at first, I probably would have been done sooner.

So, if anyone is interested in this very simple plugin, here it is. Of course, it’s GPL. I expect I’ll be adding more features to it as I need, but for now this does exactly what I want with very little code to maintain.

Documentation

Download

You can get the current version from here: simplerssembed.zip

Installation

Put the contents of simpleressembed.zip into your wp-contents/plugins directory, and unzip it. This should give you a directory called ‘simpleressembed’ which has 3 things in it:

  • an empty directory called ‘cache’
  • a file called readme.txt
  • a file called simplerssembed.php

Make sure that the cache directory is writeable by your web server, or whatever user that will be executing the php scripts. The safest way (on *nix system) is to do the following (assuming that the process runs as the user ‘apache’:

[root@ simplerssembed]# chown apache: cache
[root@ simplerssembed]# chmod 755 cache

Then go to the plugins tool in your WP dashboard, and activate the plugin.

Using the plugin

Once the plugin is activated, you can embed RSS feeds with the following shortcode:

[simplerssembed rssfeed='http://wordpress.org/news/feed/'
rssitems='5' rsscssclass="rssfeeditem"
rssdateformat="j F Y" rsslinktarget="_new"]

Parameters

The currently defined parameters are as follows:

rssfeed -> URI of the RSS feed
rssitems -> The number of items to display
rssmaxdescription -> The maximum number of summary characters to display
rsscssclass -> The class name to give the containing <div> (per item)
rsslinktarget -> The target attribute for the link to the post
rsscacheduration -> The duration (in seconds) of the cache
rssdateformat -> The data format (see PHP's date function)

Default values

The default values for the above parameters are:

rssfeed => 'http://wordpress.org/news/feed/'
rssitems => '5'
rssmaxdescription => '400'
rsscssclass => 'rssitem'
rsslinktarget => '_self'
rsscacheduration => '3600'
rssdateformat => 'j F Y | g:i a'

Example output:

This is output from the actual code above:

Celebrating Community at WordCamp Asia 2026

WordCamp Asia 2026 brought the global WordPress community to Mumbai, India, from April 9–11, gathering contributors, organizers, sponsors, speakers, and attendees at the Jio World Convention Centre for three days of learning, collaboration, and community. With 2,281 attendees, the event reflected the scale of the WordPress community and the strong turnout throughout the event. The […]

Posted on 11 April 2026

How to Watch WordCamp Asia 2026 Live

WordCamp Asia 2026 will be available to watch live across three days of streaming, making it easy for the global WordPress community to follow along from anywhere. This year’s live streamed programming begins with a special Contributor Day broadcast, followed by two full conference days of presentations from across the WordPress community. This post gathers […]

Posted on 7 April 2026

From AI to Open Source at WordCamp Asia 2026

April 9-11, 2026 | Jio World Convention Centre, Mumbai, India WordCamp Asia 2026 brings the WordPress community to Mumbai, India, from April 9 to 11, with a schedule shaped around artificial intelligence, enterprise WordPress, developer workflows, product strategy, and open source collaboration. For attendees planning their time, the program offers a useful view of the […]

Posted on 2 April 2026

WordPress 7.0 Release Candidate 2

The second Release Candidate (“RC2”) for WordPress 7.0 is ready for download and testing! This version of the WordPress software is under development. Please do not install, run, or test this version of WordPress on production or mission-critical websites. Instead, it’s recommended that you evaluate RC2 on a test server and site. Reaching this phase […]

Posted on 26 March 2026

WP Packages is Working the Way Open Source Should

When WP Engine acquired WPackagist on March 12, the WordPress developer community faced a familiar question: what happens when critical open source infrastructure ends up under corporate control? The community already had an answer in progress. Four days later, WP Packages (formerly WP Composer) launched as a fully independent, community-funded alternative, with some neat additional […]

Posted on 25 March 2026

]]>