Use WordPress As a CMS: Plugins, The Bare Minimum

How to use WordPress as a CMS is a popular question. Especially when you want to quickly throw up what is sometimes called “The Brochure Site”. Yep, that hoary throwback to Web 1.0, the static site. You’re going to template the site in PHP anyway, right? Why not just use WordPress and give your client the option of updating their content, while a million or so developers are working behind the scenes to make sure the code powering your site is the best it can be? Not a tough choice.

Besides, no one said it had to be completely static, did they? Here’s the rundown on a few plugins, the bare minimum you’ll need, that’ll turn a simple static site into a blazing fast dynamic one, with easily managed content, that you’ll love to use.

Random Content Excerpts

If we’re going to use WordPress as a CMS we need to use WordPress. That means not totally giving up Posts for the comfort of Pages. We want to take advantage of them. Think of Posts as shift-able content. Content that you can easily move around. Thanks to query_posts we can shift content by date or category or even well, just randomly shift it—with a plugin.

Except this plugin doesn’t really exist. That is, it doesn’t have a home. I just happened to stumble across it on the WordPress support forums and the person posting it there just happened to stumble across it on a mailing list. But it’s out there and we can use it.


/*
Plugin Name: Random Posts Query
*/
function query_random_posts($query) {
return query_posts($query . '&random=true');
}
class RandomPosts {
function orderby($orderby) {
if ( get_query_var('random') == 'true' )
return "RAND()";
else
return $orderby;
}
function register_query_var($vars) {
$vars[] = 'random';
return $vars;
}
}
add_filter( 'posts_orderby', array('RandomPosts', 'orderby') );
add_filter( 'query_vars', array('RandomPosts', 'register_query_var') );
 ?>

Here’s an example of it in use with query_posts and the Sandbox theme:


<div id="testimonial">
<?php query_posts('category_name=Testimonials&showposts=1&random=true'); ?>
<?php while ( have_posts() ) : the_post() ?>
<div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
<h2 class="entry-title">What People are Saying About Us</h2>
<div class="entry-content">
<?php if(function_exists(the_excerpt_reloaded)) {
the_excerpt_reloaded(50, '', 'none', TRUE, 'Continue reading »', FALSE);
} else {
the_excerpt(''.__('Read More <span class="meta-nav">»</span>', 'sandbox').'');
} ?>
</div>

I’ve highlighted the important part: &random=true. What we’re doing here is querying the database with very specific criteria, our post must be in the category named Testimonials, we only want one post and we want it selected randomly. Sort of turns the Loop into a knot—but regardless, we get what we want, a randomly selected post. In this instance, from the category Testimonials. Use this plugin and code on a custom front page or about page and you’ve got some dynamic content happening.

Random Posts Query

Cleaner WordPress Excerpts

Notice another plugin in the code above? I’m also using the Excerpt Reloaded.

<?php if(function_exists(the_excerpt_reloaded)) {
the_excerpt_reloaded(50, '', 'none', TRUE, 'Continue reading »', FALSE);
} else {
the_excerpt(''.__('Read More <span class="meta-nav">»</span>', 'sandbox').'');
} ?>

The Excerpt Reloaded cleans up the less than desirable WordPress excerpting function and turns it into something nice and 1 million times more intuitive, giving visitors something to click on (“Continue reading »” in the code above) right after they read an excerpt. No more strange bracketed ellipsis staring blankly back at us.

The Excerpt Reloaded

Category Pages as, well, Pages

Now in this case, if we’re going to go to all the trouble of highlighting content randomly, by category, do we really want to pack it down into a category and keep it there? What if I wanted to make a category page showing off all this random content? And not have it trapped in an ugly URL like this:

http://example.com/category/testimonials

But instead sit pretty near the top of the root-chain like this:

http://example.com/testimonials

Well, I’d use a plugin of course. Check out Top Level Categories by former MicroSoft developer Filipe Fortes. It pretty much does exactly what we want to do.

Top Level Categories

Search Everything

You’ve got Pages but you can’t search them. No good. Search Everything has you covered. And it doesn’t just search pages. From the plugin page:

  • Search Every Page
  • Search non-password protected pages only
  • Search Every Comment
  • Search Every Tag
  • Search only approved comments
  • Search Every Draft
  • Search Every Excerpt
  • Search Every Attachment
  • Search Every Custom Field (metadata)
  • Exclude Posts from search
  • Exclude Categories from search

Search Everything

Automatic Upgrades

Wow, I hate upgrading WordPress. It fills me with dread every time. I’m checking the codex. I’m hesitating as I drag files over. I cringe when I upgrade the database. It doesn’t have to be like this. When can Automatic Upgrade become part of the core (along with uploading themes and plugins from the admin area)? Until then make upgrading WordPress easier with this plugin.

WordPress Automatic Upgrade

Professional Typography—Automatically

The benefit of using WordPress as a CMS is that it’s incredibly easy to edit content on your site. The downfall is that it’s incredibly easy to edit content on your site. Do you see what I’m getting at here? I sweat over my layouts and the presentation of content. Making a little change here, a little tweak there. Others… not so much. If it only got rid of widows (that one lonely word hanging out on the last line of a paragraph) Typogrify for WordPress would be a design godsend but it doesn’t end there. It fixes a whole bunch of web-type oddities and keeps your content looking fine. Don’t believe me? Check out what John Boardley has to say about WP-Typogrify at I Love Typography.

WP-Typogrify

Ironically, It Really is Static: WP Super Cache

Since we’re looking to use a dynamic CMS to power a static site why not finish it up by actually making it literally static? WP Super Cache makes static copies of your dynamic pages and serves those up instead while at the same time gzipping everything and speeding up you download times.

WP Super Cache

Even More Plugins

The list doesn’t end there. There are even more great WordPress plugins that will help you perfect the management of your “simple” brochure site. I’ll keep updating this list as I find more only adding the best. You can help out by leaving your suggestions/plugin-critiques in the comments.

12 Comments

  1. I must say first, that this site is quickly turning into my first port of call for all things WP; great writing and incredibly useful tips.

    Anyway, I can vouch for the wonderful typogrify plugin. I’m wondering whether I should make the move from WP-Cache to Super Cache (any ideas?). Love that excerpts and search everything plugin too; and would one day love to see a single click WP upgrade.

  2. Hey, Thanks, Johno! I’ve added a link to your in-depth review on WP-Typogrify to the post.

    You know, I’ve never been blessed with an opportunity to put either plugin through it’s paces but I definitely would switch to Super Cache—after testing it out on a test site (like a subdomain on the same server). It’s only on version 0.5.4 right now. But casually browsing this site and my test sites with the caching on and off you can notice a big difference.

    And everyone, Johno, besides having the coolest typography site on the web, is also almost totally unbeatable on CommandShift3. Check it out.

  3. Ian,

    My other gripe with Wordpress viz using it as a CMS, is the old extensions issue on pages/posts.

    When will Wordpress give us a standardized way to control permalink formatting that covers BOTH pages and posts.

    Meanwhile I know no other way to achieve this than with a core hack… or are my htaccess skills just lacking?! -Alister

  4. That would bother me if I didn’t stick to %postname% for permalinks. There’s for sure got to be a plugin for that though. Right? Someone? Anyone?…

  5. Hi Ian. I think we might be traveling in the same blog circles? Just wanted to say hello and I love your blog. I wish I had discovered it earlier :-) WP is still so new to me so consider me a subscriber and I hope to dive into the archives over the weekend. I can tell there’s a lot to read!

  6. Glad to have you as a subscriber, Deb! I LOVE your portfolio and logo, by the way. Great stuff.

  7. I would add Feed Control to the list of plugins for using WordPress as a CMS. It adds WordPress pages to your RSS feed. You can also exclude certain pages or posts from your feed.

    Enjoying your input on WordPress as a CMS.

  8. Thanks, Kevin. I’ve added Feed Control to the list.

  9. Hello,

    I have used Wordpress as a CMS for a few projects already… I learned Wordpress when I created my blog and why stop there.. I could edit the theme to look like a custom blog so why couldn’t I do the same with CMS, basically you are just taking out the blog dates, times and just using the post to post content, you categorize it as you see it, and if you want you just post to the pages you want to post too. Clients always want control… more and more clients ask, Can I update the site? yes you can….. I never tried learning Joomla or Drupal and there are so much more.. but I believe Wordpress is going to grow more and more to accommodate CMS technologies.

  10. Hey,
    Thanks for featuring my plugin! I’m really happy with how it’s turned out.

    Also, you’ve got a cool blog here. I’ll be keeping my eye on it :)

  11. Chad, one thing I’ve noticed is that the design community around WordPress is fun. While I really love Drupal—it can do so much—I just can’t say the same thing there (yet). And yeah, WordPress is definitely going to grow as a CMS. Especially when the designers charged with making sites want to be part of a fun community.

    Hamish! You’re Welcome. Thanks for commenting. I’m crazy for the Typogrify plugin. Thanks so much for bringing it to WordPress.

  12. ” Thanks to query_posts we can shift content by date or category or even well, just randomly shift it—with a plugin. ”

    The phrase that says “even well,” doesn’t feel right. I just thought it could be phrased “, even better,” or “even, well,”

    Thanks for this excellent article !

3 Trackbacks

  1. […] Use WordPress As a CMS: Plugins, The Bare Minimum […]

  2. […] ThemeShaper.com has a good article on using WordPress as a CMS and lists a few plugins that come in handy for this: Use WordPress As a CMS: Plugins, The Bare Minimum […]

  3. […] Use WordPress As a CMS: Plugins, The Bare Minimum (tags: wordpress cms webdesign) […]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*