WordPress.org

Ready to get started?Download WordPress

Forums

Identify New post? (3 posts)

  1. bremmerm
    Member
    Posted 3 years ago #

    Does anyone know of a plugin that identifies post as new for a set period of time and will include a "new" image to show users its a fresh post?

  2. bremmerm
    Member
    Posted 3 years ago #

    Figured it out.

    <div id="content-left"> <img src="http://www.doucheon.com/images/re-defining.gif" alt="www.DoucheOn.com" />
    
    <?php if (have_posts()) :  /* <<<<<< Start of WordPress Loop */
    
      $i=0; /* <<<<<< Set Variable  */
    
      ?>
    		<?php while (have_posts()) : the_post();  /* <<<<<< Post Loop */
    if($i<=4) $txt="<div class=\"new-post\"></div>"; /* <<<<<< insert repeated html - also set amount of post it will repeat through by changing "4" */
    else$txt=" ";
    
    $i++;
    
      ?>
    
      <?php echo $txt; ?>/* <<<<<< Use this for HTML Out Put */
  3. Purusothaman
    Member
    Posted 2 years ago #

    Hi,

    Thanks for this trick.

    Please let me know in which file should I make this changes?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.