WordPress 2.8.3 security release
Update: There's a newer release available. WordPress has just announced a new upgrade, 2.8.3. This is a security release so please do upgrade as soon as you see the "upgrade" button on your dashboard. While you're over at wp.org, check out some of the new media-related features that may be coming in 2.9.... Read more
Counting posts : $wp_query->found_posts
Sometimes you'll want to display posts in different ways depending on how many results your WordPress query has found. For example, if you're on a category archive page, you might choose to have posts shown in full if there are only one or two results, have titles + excerpts shown if there are fewer than a dozen, and just show clickable titles if there are more than that. Or you might want to run... Read more
Plugin: Better Excerpt
If you're new to WordPress, the_excerpt() is a template tag that allows you to include just the first 55 words of a post. It's useful if you want a magazine-style front page with lots of snippets of posts; some themes also use it in sidebars for teasers for recent posts. The problem with the_excerpt() is it's not very flexible. It's fixed at 55 words. It's wrapped in <p> tags. The... Read more
How to exclude a category from your blog's feed
Often you'll want to exclude a particular category from your blog's RSS feed - whether it's an archive of your Twitter posts, or a category you're using for some kind of housekeeping. It's easy to do - just edit the category number in this code, and add it to your theme's functions.php file. function feed_the_cat($query) { if ($query->is_feed) { $query->set('cat','-1'); //change... Read more
My First Plugin (that actually does something)
I have to say that if you've ever had the slightest inclination to write a WordPress plugin, Vladimir Prelovac's book is exactly what you need. I'll write a proper review once I've finished it, because (like reading the best erotica) I have to keep stopping. So if for no other reason than to amuse future-me at how basic I once was, here's what I wrote this afternoon. It translates blog posts into... Read more
Baby steps
Just because I'm feeling a bit pleased... Read more
What's the difference between archive.php and archives.php?
My copy of WordPress Plugin Development by the lovely Vladimir Prelovac has just arrived, so excuse me if I have my nose in the book the for the rest of the day
Just a quickie because this comes up in Google searches just about every day - what's the difference between archive.php and archives.php? It's quite possible that your theme doesn't have these two confusingly named files: but... Read more
"Akismet has detected a problem."
Since I've upgraded to WordPress 2.8.2 and a new version of spam-killer Akismet, I've had an annoying error message just about every time I've looked at the dashboard of any of the blogs I look after: Akismet has detected a problem. A server or network problem is preventing Akismet from working correctly. Clicking for more information gets me an even more alarming message: Server... Read more
"WordPress Theme Design": Tessa Blakeley Silver
I had my first sneak preview of this book at WordCamp in Birmingham last year, and was pretty excited to see the nice people at Packt putting out books specifically about WordPress. I've yet to read the rest of the series, but I must say I'm disappointed in the Theme Design offering. When a book has a title like WordPress Theme Design, you expect its remit to be pretty specific: it should be... Read more
Making a list of blog authors : get_users_of_blog and get_userdata
Following on from a previous post on how to make author profile pages for WordPress, Jabril and a couple of others asked how to make a page listing all the authors of a blog, with bio information and a photo. Here's how to do that. Some things before we start: You'll need to adapt this for your own theme (probably): e.g. you might need to add get_sidebar() in the appropriate place, or... Read more









