How this blog works – 200905 edition
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 …
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