IN Blogging
posted Wednesday, December 24th, 2008
It seems like there is a new WordPress version every few months. This is great from one perspective i.e. we get great new features and it just keeps getting better. However, seeing from the other end of the spectrum it also means that we have to upgrade and make changes to our theme and make sure there are no broken plugins.
My last version was WP 2.5.1 and I finally upgraded to 2.7 last night. It was more or less a painless task since all of my plugins still work with 2.7. At most I had to update them via the one-click plugin update (it is more like 2 clicks but who’s counting
).
However, it did require some changes in my theme. I could have lived without these changes as my theme did not break … I just wanted some of the new features to work.
So here’s the low down on some of the main changes in WordPress 2.7 and how to deal with them:
This has to be the biggest and best change yet. The admin interface has improved threefold. It is so much easier to get to the section you want to open. It is just faster and easier to use not to mention it looks great.
Personally I always thought the dashboard real estate was always wasted. Not anymore. It now displays a hoard of important info including recent comments, drafts, statistics, etc and also lets you add a quick post directly from the dashboard.

You can now choose the boxes you want displayed on these pages as well as drag them around to suit your preference.

You can choose which columns to display. Mouse over a post to display menu options like Edit, Quick Edit, Delete, View.
Quick Edit brings up some basic editing options for the post. Among other things you can change categories, add tags, edit the title, slug, etc as well as make a sticky post.

As mentioned above, the quick edit option lets you mark a post as sticky so it stays at the top of your blog. However, one small change needs to be made to your theme regarding this.
Find your post loop in index.php, archive.php, category.php. Look for the starting div … something like this:
<div id="post-<?php the_ID(); ?>" class="post">
Change this to:
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
You can also add one or multiple classes to this as follows:
<div id="post-<?php the_ID(); ?>" <?php post_class('class1 class2'); ?>>
The classes need to be separated by a space.
There are a lot of improvements related to comments. Not only can you perform bulk actions like marking as spam, deleting, etc, but you can finally reply to comments from within the WP admin interface. About time this feature got added. The only thing I miss is a threaded reply feature here.
A menu pops up when you mouse over a comment giving you the option to reply, edit, delete, etc.

These two much needed features have been added to the core WP installation. No need for plugins to do either.
Go to settings and then discussion. Here you will find the option to set pagination and threading on along with the settings. You can choose the number of comments to display as well as how deep the threading should go.
Now for the harder part. These two features require a change in your comments.php file. This is all you need to display your comments:
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<ol id="commentlist">
<?php wp_list_comments('type=comment'); ?>
</ol>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
You also need to add this line to your header.php file:
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
This is just the basic comment code which works with pagination and threading. You can style the basic code or add a call back function for extreme styling or in other words your own custom comment design.
I will try and cover that in another post.
If you have a logout option in your theme, make sure to replace the logut url with:
<?php echo wp_logout_url(get_permalink()); ?>
…some of the changes in WP2.7. The goods news is that your old theme from WP 2.6 and 2.5 will still work as will most of the plugins. You only need to make the changes if you want to add the new comment features.