webcomm
Member
Posted 4 months ago #
Hi,
I'd like to set up a blog with three columns and display only posts of category #1 in column #1, posts of category #2 in column #2, etc.
Is there a theme that does this? What would be the simplest approach? I'm sure I could finagle it with PHP, but just want to make sure there is no prefab approach that I might be overlooking.
I figure I would show the most recent 5 posts for each category in the left, middle and right columns... and the "older posts" link at the bottom of each column would lead to a more standard layout with posts for just that one category, starting with the 6th newest post.
Thanks,
Ryan
I don't know about pre-fab stuff, but you can do it with multiple loops and query_posts. This has been working for me:
<?php query_posts('category_name=featured');
if ( have_posts() ) : while ( have_posts() ) : the_post();
$do_not_duplicate = $post->ID;?>
<!--do stuff-->
<?php endwhile;
wp_reset_query();
?>
Although I've been having a hard time avoiding duplicate posts. If your categories don't overlap this will work.
i have same setup(pull more than 5 cat) in my theme which execute more than 175 queries in home page , believe me small host won't host your blog
which require to much resource