WordPress.org

Ready to get started?Download WordPress

Forums

// Hack. Set $post so that the_date() works (3 posts)

  1. gulliver
    Member
    Posted 2 years ago #

    Whhen should the code below be used?

    `<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>'

  2. vtxyzzy
    Member
    Posted 2 years ago #

    I have seen this used before the Loop when wanting to display the date of the first post. So, it is placed before the 'if (have_posts())' test.

    If you are not displaying a post date before the Loop, then this is not needed.

  3. gulliver
    Member
    Posted 2 years ago #

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.