Friday, July 2, 2010

Applying different formatting to just the first post on the first page

<?php if (have_posts()) : ?>
<?php $post = $posts[0]; $c=0;?>
<?php while (have_posts()) : the_post(); ?>
<?php $c++; if( $c == 1) :?>
<h1>The first post on the main index page</h1>
<?php the_title(); ?> <?php the_excerpt(); ?>
<?php else :?> <h2><?php the_title(); ?></h2>
<?php the_content(); ?> <?php endif;?>
<?php endwhile; ?> <!-- page nav -->


More -->
http://wordpress.org/support/topic/302408?replies=6

No comments:

Post a Comment