scriptygoddess

22 Oct, 2002

category posts in columns

Posted by: kristine In: MT hacks

Someone asked about this on the MT forums, and I really liked how the answer turned out, so I thought I'd add it over here.

Some weblogs have a specific set of categories and would like to divide up the index page in columns to help segragate the posts. One such blog is BlogCritics. Other news-format blogs could be easily enhanced this way too.

This code will create the classes for the stylesheet and then the html to display them by using MTArchiveList tags. The stylesheet is adapted from Glish's example.

<html>
<head>
<title>Categorized Columns.</title>
<style><!–
body {font-size: 13px; font-family: verdana;}
<MTArchiveList archive_type="Category">
#<$MTArchiveCategory$> {
width:23%; change this depending on how many categories you have
float:left;
padding:10px;
}
</MTArchiveList>
–></style>
</head>
<body>

<MTArchiveList archive_type="Category">
<div id="<$MTArchiveCategory$>">
<$MTArchiveTitle>
<MTEntries lastn="2"> change this to how many posts you want to show for each category
<b><$MTEntryDate$><br></b>
<$MTEntryBody$>
</MTEntries></div>
</MTArchiveList>
</body>
</html>

You can see how this looks on my lovesongs (my music blog) test page. I'd recommend not using this if you have more than 5 categories, as it will leave pretty skinny columns!

3 Responses to "category posts in columns"

1 | djwudi

October 23rd, 2002 at 2:56 am

Avatar

Interesting tip! I've been doing something similar on my full archives page, but using a table layout and just the titles. I'll keep this in mind, though – might work well for other projects!

2 | cal

March 21st, 2003 at 8:32 am

Avatar

is there any way you could re-list that stylesheet to work for *anything* that one would want to have in columns? for example, i am in the process of re-doing my design at writtenonthesky.com, and want to put columns in for links, as well as my archives, etc. thanks so much!

3 | kadyellebee

October 22nd, 2002 at 10:43 pm

Avatar

SG stuff
While I'm on my updating trend this evening, I'll let you in on the two new posts I made at

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements