09 August 2005

Trick to create categories manually

Blogging without categories was annoying me. I played around a little to find a way to create categories manually. My idea was to use permanent links. This works fine. The steps in detail:

1. Create the category
I created a post to present my category and added links to all posts of this category.
i.e. Post titled 'Category: Blog'. I copied the permalink location (default: #) of the posts belonging to this category and added the links in this post.

2. Remove post from getting displayed
It is unpleasant to see the category post in the main page and in the archive. So, change the date of the post to January 1st 1990 (earliest date to specify). If we later change the post the date will be maintained. The post is moved to the end od posts and gets normally no longer displayed on the main page (except you have not very many posts yet).

3. Display the category in the sidebar
That is very easy. You have to edit your template. Find in your template the section where the links are displayed. Add a new list or change the existing one to link to the category post using its permalink.

4. Change the archive containing the category posts
The created category post is archived in an archive for 'January 1st 1990' (depending on your settings). In the template you can change the displayed name for this archive. Copy the name of the archive and copy it to the code below. I am archiving monthly and my archive was called 'Januar 1990'. A script looks for the name and changes it to 'Categories'. The archive file stays the same. This may be a dirty trick, but works fine. You can also choose not to diplay this archive, just change the script. But I like displaying for easy access of all categories.
Change the part in the tag BloggerArchive.

Keine Kommentare: