What Was I Thinking?

Archive for September 2007

Weekly Update 4

with 3 comments

Hooray, WordPress 2.3 came out! And tags are usable, but by no means ideal. No matter, I managed to do what I need to do.

Made a shitload of progress this week.

  1. Upgraded to WordPress 2.3
  2. Rolled out my basic design
  3. Got basic functional categories and tags working
  4. Fixed a bunch of stuff that wasn’t working in IE7
  5. Put up a couple of informative posts
  6. Processed a bunch of images
  7. Learned a bunch about Glycaemic Load
  8. Added Gravatars
  9. Added the sitemap
  10. MOST IMPORTANTLY: Got the secondary loop working with tags

Does anyone use Gravatars? I like the idea, but the reliability seems a bit iffy. I’m supporting them for now but will keep my eyes open if there’s an alternative. One that doesn’t involve hosting the pics myself, I mean. Between moderating the new site, The Average Gamer and my day job, I really don’t have time to vet user images. I like the rating system in place on Gravatars.

As for the site itself, it’s up at OneServing.com. The idea is to show people what one serving of each food looks like, and its nutritional value. That way, when you’re later eating a Big Mac you can look at the amount of lettuce and go “Hey, half a serving of lettuce. Only need to eat 14 more of these today and I’ll be on my way to a healthy diet.”

The bit about the “secondary loop” – the idea is that people can also submit their own food tips on each food page. For example, you’re looking at a serving of cherry tomatoes. You think “Hey, I think cherry tomatoes are fantastic in a grilled cheese sandwich”. You can sign up with the site and let the world know your tip for grilled cheese and cherry tomato sandwiches. Tag it with “cherry tomatoes”. Everyone who then looks up one serving of cherry tomatoes will see your idea displayed below. If you’re signed up with gravatars, they’ll also see your picture.

That functionality isn’t available yet. It probably will be by this time next week. In the meantime, see what’s in one serving of cherry tomatoes.


Written by Weefz

30 September, 2007 at 10:32 pm

Weekly Update 3

leave a comment »

Not many noticable changes this week. Cleaned up the template code, sorted out the sidebar (adbar) and removed all the development “helpers” – things like ugly orange borders around containers so that I can see why things are appearing in strange places.

Also set up the colour schemes and channels for Google AdSense – I’m using AdSense as a placeholder until the website generates enough traffic to sign up to affiliate programs and sell ads directly.

Didn’t want to do too much as WordPress 2.3 is due out today. I’d be very annoyed if I spend ages hacking something together only to find out that it’s already available out-of-the-box in 2.3. Spent enough time on that with tags, thankyouverymuch.

Hope WP2.3 does come out today. I want to get my layout up and running ASAP.

Written by Weefz

24 September, 2007 at 11:01 am

Weekly Update 2

leave a comment »

Not much progress this week – I broke the adserver on The Average Gamer last week and spent most of my free time trying to fix it. All finally done today. Turns out OpenAds 2.4 isn’t an obvious improvement from the 2.0.x I was using previously. Arse.

On the other hand, the experience of reinstalling OpenAds was directly relevant to my new site. I also found some time to research a bit of food info and take some photos. The week wasn’t a total loss.

Written by Weefz

17 September, 2007 at 7:58 pm

Stop Prefacing Your Posts With AdSense!

leave a comment »

AAAAAARGH! I am SICK of going to websites and being confronted by AdSense Large Rectangles. Seriously, people. Just stop it. Have the decency to put a little bit of content above the fold.

That is all.

Written by Weefz

10 September, 2007 at 10:47 pm

Posted in ranting

Weekly Update 1

with one comment

Lots of progress this week. I have been obsessing over the project slightly. Worked on it all day yesterday, most of today and 3 evenings during the week.

At the moment, I’m focusing on developing a suitable WordPress theme. The main information pages are rather specialised so I shall have to give you an explanation as to how it will work.

Single posts providing information on [my secret topic] will actually show multiple posts. The first post will be the main information section. Registered users will be able to write their own posts providing tips and and their own experiences with [secret topic item]

To this end I need to use multiple loops on the post pages for that category. I will also need to take a parameter from the initial post and pass it into the secondary loop in order to get the correct set of posts. e better part of a day peering through the php files and function. I finally adapted a few to pass the ta

Sounds tricky, no? I spent several hours yesterday and today looking at tagging plugins to do the job. The idea was that I tag the initial post with something, then pass that tag over to the secondary loop. That loop will then pull tips and article posts with the same tag.

Turns out that no tagging plugins will let you extract only the tagged posts under a certain category. Even less helpfully, they won’t let me access the tag variable – Ultimate Tag Warrior outputs the tags in such a way that I can’t store them as a variable. Finally, there’s no accessible function I can use to pass in a tag and get the posts back for my secondary loop. I spent thgs into a usable variable… and you know what?

WordPress 2.3 (release date 24th September) will have tagging BUILT IN! Aaaaargh… all that work!

Never mind. Built-in is all the better. I like to minimise my plugin usage so that I’m not reliant on other people for upgrade. Guess I won’t be launching before September 24th.

The other tricky part was the navigation. Each post needs to be in multiple categories and multiple subcategories. For example – let’s say I was listing information about shoes. For each shoe I would have the following:

  • Manufacturer: Nike
  • Colours: Red, Black, White
  • Materials: Cotton, Plastic

I want to be able to click on each of the above fields to find shoes with similar properties. To do this, Manufacturer, Colours and Materials are parent categories. Nike, Red, Black, etc. are subcategories.

The problem is, there is no way within WordPress 2.2 to only list the post’s subcategories of a given parent. You can list all the post’s categories, and the subcategories of a given parent for the entire website, but not for the post. I wrote a plugin to do the job. I’ve (imaginatively) called it ‘Weefz’s Show Post Subcategories’. I’ll probably release it properly later this month so drop me a comment if you want the plugin. It’s quite simple so should work with pretty much any version of WordPress. You can even customise the output with your own separators, prefix and suffix.

Equally, let me know if there actually is a WordPress template tag that shows only the post’s subcategories of a given parent category. I couldn’t find it.


  • Wrote my first plugin, in a programming language I don’t even know. Hooray! :) (I am a trained programmer, so it’s not as ugly as this makes it sound ;)
  • Tabbed navigation with rounded corners. (Woooo!)
  • CSS drop shadows. (For that professional look)
  • And a “single” post template that incorporates multiple WordPress loops.

Sure, basic stuff for a web developer but all new to me. I am happy :)

Written by Weefz

9 September, 2007 at 7:45 pm

Milestone: I will be using WordPress

leave a comment »

I don’t want to use WordPress as it’s not exactly friendly to new users but the current appalling state of design documentation for Movable Type 4 has left me with no choice. I have wasted far too much time installing and uninstalling different options. I’ll get the site up and running and if it gets positive feedback I’ll look into porting it to something more suitable.

I’m making extensive use of the custom fields in WordPress, so it will probably be a nightmare to convert to any other content management system (CMS). Never mind. I want to get a hundred (fifty?) entries up as soon as possible. I shall worry about portability later.

For those who are interested, here are the advantages of WordPress, in order:

  1. I already know how it works. My other website is built on it.
  2. If I want something customised, someone else has probably already written a plugin.
  3. If there is no plugin, there’s enough documentation to figure it out myself.
  4. It’s free!
  5. Custom fields are free! (not $125-450 like the well-known Movable Type plugin)

Part of the website concept is that any user will be able to sign up and post their tips or experiences. I was initially worried about them potentially screwing up the custom layout but the Access by Category plugin should prevent that.

Things are progressing quickly now that I have chosen a CMS. Next phase is to find or write a plugin that will list comma-separated categories. The only options for wp_list_categories at the moment are showing them as list items or separated by a <br \>. See the WordPress Codex wp_list_categories documentation for more detailed info.

I also have to teach myself how to display individual custom post fields. Doesn’t look particularly difficult.

Finally, must find a plugin/option that puts posts into a moderation queue. Don’t want spammers signing up to just promote their Made for AdSense websites :P

Written by Weefz

5 September, 2007 at 3:41 pm