Beschreibung
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">→</span>'); ?>
<?php else: ?>
<?php echo the_excerpt(); ?>
<?php endif; ?>
Installation
- Unzip the plugin package and upload it to
/wp-content/plugins/
directory - Activate the plugin through the ‚Plugins‘ menu in WordPress
- Use your new is_latest() template tag in your theme’s loops.
FAQ
None yet. Be the first, I dare you!
Rezensionen
Für dieses Plugin gibt es keine Rezensionen.
Mitwirkende & Entwickler
„Is Latest Post?“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:
MitwirkendeÜbersetze „Is Latest Post?“ in deine Sprache.
Interessiert an der Entwicklung?
Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.
Änderungsprotokoll
0.2
- Fixed sql query sentence for latest WordPress versions (> 3.2.1)
- Improved usage examples
0.1
- First implementation
- Created readme.txt file