WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar showing posts change? (3 posts)

  1. armstrong1118
    Member
    Posted 6 years ago #

    I am currently using wp_get_archives('type=postbypost&limit=5'); in my sidebar to show my last 5 posts, but it only shows the title of the post. Anyone know how to make it so I can also show the date of the post?

  2. armstrong1118
    Member
    Posted 6 years ago #

    Stupid question, the answer was too easy. I just used the_time('F j, Y');

  3. armstrong1118
    Member
    Posted 6 years ago #

    soooo, while the_time('F j. Y'); gives me the date like I want, it only does it for the item. I think I need to use for each: item in this but I have no idea how.....anybody?

    <?php
    if (is_page('home')) {
    echo "

  4. <span class='head'>LATEST NEWS</span>
  5. ";
    echo "
      ";
      wp_get_archives('type=postbypost&limit=5');
      echo "<small>posted on: ";
      the_time('F j, Y');
      echo "</small>
    ";
    } else {
    echo "<p>Try again</p>";
    }
    ?>`

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.