This is a WordPress blog. I have done so many sites in WordPress lately that it’s starting to be hard to keep track. Maybe I should back track a bit …

My name is Tony Hang Shing Chu. I am a web designer. As of this post (May 20th, 2009) I work at the University of British Columbia‘s Public Affairs office as a web coordinator. This is my (so called) professional blog, where I promise I will try to be a professional, and blog about respectable, work related things like web design & programming & volunteering & stuff.
Disclaimer – this blog is essentially a reference for me, because my memory is so bad. I need to remember and document every trick I try to pull in my design/programming work, else I will forget them all. (Hence the name, “Tutorial for my future selves.”) Some of you may find some of this useful, but I make no guarantees about the fitness/applicability of anything I post here. I’ll try to be helpful though, if ever any of you have questions for me.

Getting down to business

How does this blog work? Right now it is a theme package that makes use of the css framework from blueprintcss.org. I have left the site-wide css and the html structure as bare bone as wordpress would allow. This was done in hopes that I can try to do the “art directed” blog thing that Jason Santa Maria proposed. We’ll see how well I can follow through with this.

Some WordPress trickery

I am essentially making extensive use of custom fields. I define some CSS rules as a custom field with the key “styles”. The header.php script looks for this and attaches it if it is there. CSS rules defined in the custom fields will override any default styles on the site. I have a similar set up with javascript, leveraging JQuery‘s document-on-load functionality.

Benefit of good defaults

Why use blueprint & jquery? I am trying to get good defaults. Blueprint (like other CSS frameworks) works out the kinks of cross-browser css design. I can focus on creating the layout I want for each post. Similarly, using jQuery establishes a common set of functionality I can leverage. With these defaults in place, I am free to override them to my heart’s content, while knowing I have something decent to fall back on.

I will try to explain this in more detail in a seperate post.

When I said trickery, I am not kidding

<?php $styles = get_post_meta($post->ID, 'styles', true);
// Custom Field - http://codex.wordpress.org/Using_Custom_Fields ?>
<?php if($styles!=''): // If we actually got some javascript ?>
<style type="text/css" media="screen,projection">
<?php echo $styles ?>
</style>
<?php
endif; // End style custom script
?>

Actually, I should really write a separate post to document all the trickery here. I will leave my first post here for now. I hope you enjoyed this … haha.

Tony

 

May 20, 2009

One Response to How this blog works – 200905 edition

  1. Pingback: Fragments of Ricochetting Thoughts | Design Blog

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>