Archive for November, 2008

wordpress-tips category image Individual Category Styling

Did you know that you can make your category archives individual in style for each? Take this site as an example. If you take a quick look at the categories here [as listed above in the menu bar] you can see that each archive has it’s own introduction, particular to each on an individual basis. Likewise, the Post Its archive is styled slightly differently, in that it has no category bar underneath each post, as do the other archives.

So, how do we get this result? Well, it is quite simple to be honest. All you need to do is copy your archives.php code into a text editor and then set about making any changes you wish. You can make as many structural and CSS changes as like and is only limited by your imagination. To make each one display differently on your site, you need to save each with a different name. This is the important bit and is controlled by something known as the WordPress Template Hierarchy, which without going into too much detail here, runs something like this [as applied to categories]:

Category Templates:
1. category-id.php – If the category’s ID were 6, WordPress would look for category-6.php
2. category.php
3. archive.php
4. index.php

So, what you need to do with each individually structured/styled category archive is simply name it appropriately, i.e as in the example above: category-id.php

In my instance on this site, the Post Its category is ID:24, so my category archive template is named category-24.php. My Themes category archive is based on it being category ID:14, so it becomes category-14.php and so on.

It is then just a simple matter of uploading your new files into the relevant theme directory and hey presto, you have individually styled category archives on your site.

wordpress-tips category image Individual Post Styling

Sometimes it is very handy if you can change the styling for a particular post, but not have to change it for all. I would imagine there may be a plugin available that does this, but to be honest, I haven’t actually looked.
Anyway, one easy way to do it is to take note of the ID for the post you want to style and then apply a bit of styling within the post itself.
To find the ID for the post is easy. You can see it when you are actually writing the post, so just look in your browser address bar and you will see something like the following:

http://jamesict.com/wp-admin/post.php?action=edit&post=96&message=7

The important bit we need is the post=96 [just take note of the number].

And all we have to do is then apply a bit of styling via some quick CSS.

To do this we apply some style tags and throw in whatever CSS changes we choose. I have made a simple background colour change to this post by applying:

#post-96 .entry {background:#BEC3B3;text-align:justify;}

In my CSS, the posts also fall under a class of .entry too, so I have included this in the CSS change.

post-its category image 2.7 Beta 3

Jamesict.com is now running on WordPress 2.7 beta 3

post-its category image 2.6 Easter Egg

And it’s not even Easter

post-its category image WordPress 2.7 Release

A complete list of all the features available in the new, upcoming version.

post-its category image WordPress 2.6.5

Recommended as it fixes a few more security threats.