Aug
9
Two Plugins to help turn WordPress into a CMS
Filed Under Computers & Tech on August 9, 2014 at 4:31 pm
As described in a post earlier today, I have made some significant changes to this site. The short version is that I’ve started to use WordPress as a CMS (content management system). While the WordPress APIs provide a good range of functions for doing CMS-like things, the web interface is disappointingly lacking in even basic CMS features. Thankfully, WordPress’s plugin architecture has allowed the community to fill in the gaps.
As a rule, I install as few plugins as possible. Each extra plugin adds a little more attack surface to your site, so install exactly as few plugins as you need to create the site you want, no more, no less.
At the heart of a CMS is the ability to collect properly categorised and tagged content together into meaningful views. In short, you need to be able to generate lists of posts or pages matching a given criteria, and insert those lists into a post or a page. You need to be able to mix these lists into user editable content, so what you really need are WordPress short codes that expose this functionality. There are quite a few to choose from, but I have settled on just two, one focused on posts, and one focused on pages. There is some overlap between the two, but both have features the other does not.
A Plugin for Listing Pages
Lets start with the simplest one, a short code for listing pages. The critical feature from my point of view is the ability to insert a short code to list all pages that are child pages of the page the short code is inserted into. The plugin I chose is page-list. This plugin provides the following short codes:
[pagelist]
– which generates a nested tree of pages, basically, a site map.[subpages]
– which generates a nested tree of pages with the current page as the root of the tree – basically a single branch of the site map. This is the short code I really need.[siblings]
– which generates a nested tree with all the current page’s siblings as roots of the trees.[pagelist_ext]
– which generates the same as[pagelist]
, but includes page excerpts.
All of these short codes take arguments to modify their behaviour in various ways, for example, the depth
argument can be used to limit the depth of the trees, and pages can be excluded from the listing using the exclude
argument. You can see the impressively comprehensive list of supported arguments here.
A Plugin for Listing Posts
The second plugin I need is one that provides a short code for listing blog posts that meet a certain criteria. Again, there were many to choose from, but the one I settled on is Display Posts Shortcode. This plugin allows just a single short code, [display-posts]
, but it’s a very versatile short code supporting an impressive list of arguments and enabling many different searches, renderings, and sort orders. For a full list see the plugin’s documentation wiki.
I’m primarily using the short code to filter based on tags, but it really is impressively versatile.
[…] Since WordPress now describes itself as a CMS rather than a blogging platform, I had expected to find all the tools I needed for this re-design built in, but I was disappointed. While the APIs provide all the needed functionality to theme developers, there is very little CMS-style functionally presented through the web interface. Trivially simple things like the inclusion of posts or pages matching a given criteria into a post or page are just not there out of the box. I have a custom theme, and I’m not afraid of writing code, so I could have made all my changes by editing the code of my theme, but I wanted to do as much as possible in a theme-agnostic way. This current theme has served me well, but it’s not responsive, and realistically, it needs to be changed soon. Thankfully a lot can be achieved with just a few plugins, so most of the changes I’ve made are not theme-dependent. (see my review of those plugins here) […]