I added a notes category quite some time ago, but I’ve done some additional work to make my notes work a little better.
What are notes?
Notes are shorter posts that I write. They could include passing thoughts, or links to sites that I have found interesting. Basically anything that I consider noteworthy that doesn’t justify an entire post.
I originally got the idea from a couple of other blogs that I regularly read. Matthias Ott has his Notes section and Sara Soueidan has The Desk. Both of which are chock full of interesting posts that are generally short thoughts, but not always.
Previously I had the Misc category that was a kind of dumping ground for posts that didn’t fit anywhere else. After seeing Mattias’ and Sara’s solutions, I knew a notes section of my own was the answer.
I figured there was a few ways I could add a notes section to this site. I could add a WordPress plugin, or maybe a custom post type. Maybe I just create a new category called Notes and be done with it.
I’m a believer in the KISS principle. So I wanted something that was easy to implement and maintain. Adding another WordPress plugin was a non-starter; I don’t like adding plugins at the best of times, and for something as simple as this solution, it seemed unnecessary.
I toyed with the idea of adding a custom post type where there was an option for creating a new Note in the WordPress admin UI. This was very simple to do, but it went against the KISS principle – it was adding complexity for the sake of it.
The way I see, all my posts – whether they’re long-form technical articles, an IndieWeb reply, or a short note – are still posts. So adding a whole new UI for writing Notes seemed pointless.
Notes category it is then.
Custom Category Page
The category pages on this site have always needed a bit of love. Their feeds are different than the main homepage feed, and they just looked wonky. I took this as an opportunity to fix that.
If you look at one of my category pages, you will see that the page title is Category:[Name]. I didn’t want that for my notes page, instead I wanted to tweak the title and add and introductory paragraph.
Luckily, WordPress has this hierarchy within its themes where it will look for custom pages to render before it renders the main
index.php file. That process looks something like this:
category-slug.php → category-id.php → category.php → archive.php → index.php
This theme is SUPER simple, so I don’t have a dedicated category page. I do, however, have an
archive.php page. This is the file my theme uses to render category pages.
So I copied
archive.php and renamed it to
category-notes.php. I customised it to suite my needs, uploaded it to my server and hey presto! I have a custom Notes page.
WordPress’ URL structure for categories looks something like
/category/[name]. I wanted to be able to use
https://kevq.uk/notes for my Notes page.
Again, keeping the KISS principle in mind, the easiest way of doing this was a simple redirect. To do this I simply added the following to the bottom of my
# Redirect notes page Redirect /notes /category/notes
/notes will now redirect to the correct category page, so it’s pretty seamless.
The Notes page has proven to be very useful over the last few months, so creating a custom page and URL path for my Notes seemed like the right thing to do.
Categories also have their own RSS feed in WordPress, so I haven’t had to do anything clever for someone who wants to subscribe to just my Notes feed. Better still, the redirect also works for this too, so if you visit https://kevq.uk/notes/feed, you will be taken to the Notes RSS feed.
I think notes are a great way for bloggers to share quick thoughts and ideas. Thanks to Matthias and Sara for the original inspiration.