Forums

[resolved] Most Recent Post in all Cats (3 posts)

  1. hearkening
    Member
    Posted 2 years ago #

    I'd like to show the last post in 3 specific categories on my front page. Here's what I have so far:

    <?php query_posts('orderby=name&order=asc&category_name=upcoming-events&showposts=1'); ?>
    		<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    
    			<div class="category">
    				<h2><?php the_category(); ?></h2>
    				<span class="date"><strong>Last Updated</strong>: 07/14/2009</span>
    				<div class="post">
    					<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    					<?php the_content(); ?>
    				</div><!-- / .post -->
    			</div><!-- / .category -->

    That works great, but I'm not sure how to show the other two categories. I'm a complete PHP noob. When I try to sort of duplicate this I get PHP errors with the loop. Any help would be greatly appreciated. Thanks!

  2. hearkening
    Member
    Posted 2 years ago #

    TTT

  3. hearkening
    Member
    Posted 2 years ago #

    Nevermind. A PHP friend help me figure it out by using multiple loops. http://codex.wordpress.org/The_Loop#Multiple_Loops

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags