Have you noticed?

! This post hasn't been updated in over a year. A lot can change in a year including my opinion and the amount of naughty words I use. There's a good chance that there's something in what's written below that someone will find objectionable. That's fine, if I tried to please everybody all of the time then I'd be a Lib Dem (remember them?) and I'm certainly not one of those. The point is, I'm not the kind of person to try and alter history in case I said something in the past that someone can use against me in the future but just remember that the person I was then isn't the person I am now nor the person I'll be in a year's time.

At the bottom of every post you will now see an extra line above the post information (date, time, comments, etc.) telling you what mood I was in when I wrote the post.

I’m a great believer in open source so if anyone wants to implement this in their own WordPress blog, read on …

The following code needs to be added in the Single Post (usually single.php) and Main Index Template (usually index.php) immediately before the text “Posted By” (or the equivalent if your template says something different):

  <- Click for code

To make it work, at the bottom of the page when you write a blog post you’ll see a section with the title “Custom Fields”. The first time you do this you will need to add a new Key with the name “Mood” (case sensitive). Subsequently you will be able to select Mood from the dropdown list. When you write a blog post, select Mood from the dropdown list and write your mood in the “Value” textbox on the right of it.

When you publish your post, whatever you wrote for Mood will appear above the post information. The extra line will only appear if you enter something for Mood. For styling, you could give the span tag a class and style it through your stylesheet or give it an inline style.

4 comments

  1. Calum (183 comments) says:

    I’d noticed that, was wondering how you did it. Think it is ironic that on your post telling people about it that you seem to have forgotted to put the mood thing in.

  2. wonkotsane (1133 comments) says:

    I was more concerned with trying to get the damn code to display properly. I have a better workaround than a textarea which I’ll do later. 😉

    I’ve added a mood, is that better? 🙂

  3. Calum (183 comments) says:

    🙂

  4. revinkevin (176 comments) says:

    Nice and simple looking code.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.