WP : loop full article + excerpt

<?php if (have_posts()) : ?>
    <?php $count = 0; ?>

   

    <?php while (have_posts()) : the_post(); ?>
        <?php $count++; ?>

       
        <h3>Title: </h3>
        <h4>Date: <?php echo date(“l, F d, Y”); ?> | <?php comments_number(); ?></h4>

        <?php if ($count == 1) : ?>

            <?php the_content(); ?> // display the full content of the first post only

            <h4>Please subscribe to my feed!</h4>

        <?php else : ?>

           
            <?php the_excerpt(); ?> // display only the excerpt for all other posts

            // for all posts except the first, process this code below each post

        <?php endif; ?>

        // for each post, including the first, process any code included here
        // any code output will be displayed below the content of every post

                        <h4>This is post #<?php the_ID(); ?> | Author: <?php the_author(); ?></h4>
        <p>Filed under: <?php the_category(‘,’); ?> | <?php edit_post_link(); ?></p>

    <?php endwhile; ?>

    // stop the post loop and process any code included here only once
    // any code output will be displayed below the entire set of posts

                <h4><?php posts_nav_link() ?><?php previous_post_link(); ?> •
        <?php posts_nav_link() ?><?php next_post_link(); ?></h4>

    <?php else : ?>

    // if there are no posts to display, process any code that is included here
    // the output of any code included here will be displayed instead of posts

              <p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>

// any code included here occurs after the wordpress loop and is always displayed
<h6>Copyright &copy; <?php echo get_settings(‘home’); ?>/”><?php bloginfo(‘name’); ?></a> <?php echo date(‘Y’); ?></h6>

Posted via email from Netlex’s codebox

Advertisements

~ by netlex on October 8, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: