Viewing 1 replies (of 1 total)
  • I am using this code to style the first output in a query.

    Hopefully it will help you do what you want.. 🙂

    <?php query_posts(''); ?>
    <?php if ( have_posts() ) { ?>
    	<?php $post = $posts[0]; $c=0;?>
    	<ul>
    		<?php while ( have_posts() ) : the_post(); ?>
    			<?php $c++;
    			if( $c == 1) : ?><!-- The first post displays like this -->
    				<li>
    					<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    					<?php the_excerpt(); ?>
    				</li>
    			<?php else :?> <!-- The rest of the posts -->
    				<li>
    					<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    				</li>
    			<?php endif;?>
    		<?php endwhile; ?>
    	</ul>
    <?php } else { echo "No posts"; }?>

Viewing 1 replies (of 1 total)
  • The topic ‘First post template’ is closed to new replies.