• What would be the best way to have different “templates” for posts appearing in a loop? I have a pretty good grasp of CSS, WordPress, and how the two interact—but all I’m finding it advice on how to modify CSS per page, not per post within the loop

    A really good example is how Gawker or Gizmodo can individually format their posts.

    Here’s what I’m talking about:

    http://gawker.com/5107416/new-post-types-on-gawker-sites

    How can I do this well? Not instructions, but good strategy. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • How about first deciding how many different displays you want (eg. 4 called style1, style2 etc). Then doing floor(post id/4) to obtain an integer which you can then add onto to “style” to produce class="style3 etc which can be added to the <body> tag or similar dynamically? That would give you a random style.

    If you want to apply styles on a pre-catgeory basis, you could use in_category() to apply the appropriate class. In theory, you could do something similar based on tags. Or post date. It really depends how/when you want to apply the different styles.

    I’d like to know how to do this. Is there any way to do this using custom fields?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Like Gawker and Gizmodo: How to Format Individual Blog Posts Within the Loop’ is closed to new replies.