This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Is Latest Post?

Description

This plugin adds a template tag called is_latest() to know if the current post in the_loop() is the latest post.

Examples

Use h1 for the latest post’s title, h2 in the remaining posts:

<?php // Code taken from TwentyTen loop.php file ?>
<?php while ( have_posts() ) : the_post(); ?>

  // [...] blah blah blah

  <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <h<?php echo (is_latest()) ? "1" : "2" ?> class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h<?php echo (is_latest()) ? "1" : "2" ?>>

    // [...] rest of the post stuff
  </div>

  // [...] more blah blah blah

<?php endwhile; // End the loop. Whew. ?>

Show full content on latest post only, summary on rest:

<?php if (is_latest()): ?>
  <?php the_content('Continue reading <span class="meta-nav">&rarr;</span>'); ?>
<?php else: ?>
  <?php echo the_excerpt(); ?>
<?php endif; ?>

Installation

  1. Unzip the plugin package and upload it to /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Use your new is_latest() template tag in your theme’s loops.

FAQ

None yet. Be the first, I dare you!

Contributors & Developers

“Is Latest Post?” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.2

  • Fixed sql query sentence for latest WordPress versions (> 3.2.1)
  • Improved usage examples

0.1

  • First implementation
  • Created readme.txt file