Thursday, May 20, 2010

Stylin' your blog-post-order hack (part 1)

You've jumped through all the hoops to get your blog content listed in order, oldest first, on your blog: feed, pipes, javascript, and back on a static page on your blog.


The next part of the hack uses cascading style sheets to format how your feed looks.

Are you satisfied with your formatting? If so, skip this step and go here. (If you're not sure, maybe this will help you think about whether to tweak the formatting.)

Otherwise, prepare yourself for a peek under your blog's hood.

Cascading style sheets have become the standard method for applying formatting to web pages. The idea is that instead of embedding formatting commends into the web-page code (using, for instance, the old FONT tag to select the typeface), web sites such as your blog separate formatting from content.

Consequently, when you publish a blog post titled "Stylin' your blog-post-order-hack," Blogger writes code that looks something like this:
<h3 class='post-title entry-title'>
<a href="http://URL">Stylin' your blog-post-order-hack</a>
Blogger has elsewhere defined the formatting for </h3> (heading 3) and also for all hyperlinks within heading 3 (the <a>...</a> tag).

Blogging is not normally about code, and Blogger protects you from having to mess directly with this stuff. Nonetheless when you use Blogger's Template Designer to change the color of a blog element, it's the style sheet that gets changed. The new style then flows directly onto the way your blog is rendered on screen.

In this case, there is no handy Blogger-designed user interface. We'll have to delve into the code ourselves.

Strap on your mining hat and let's go.


  1. Hi! I love all this great info but some of the terms(embedding formatting codes into the web-page code, formatting your 'feed' etc.) sometimes gets lost on people like myself. I'm so sorry cause I ain't computer illiterate but when I start something new I get lost in the terms before I have a chance to understand it. Great site. Another one I will follow and pass on to my bloggers. Just started and having hard time organizing it...cause of the terms....again! Deb Vancouver Island British Columbia

  2. Sadie, guilty as charged!. I think the stuff in this column, and the next, is pretty gnarly.

    It does let you format your feed to look like your blog, however, which might be important to you or it might not.

    Thanks for dropping by! The "blog elements" tab above links to stuff that is less esoteric and I hope of use to the average blogger.