Support » Fixing WordPress » display random posts on index.php instead of latest

  • Resolved rhonorginal

    (@rhonorginal)


    Hello.
    I have the settings so only one post (which is by default the most recent) displays with index.php

    my current working code
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    How could I change to code to display a random post from any category/date?

    It just needs to be one post if that makes a difference.

    many thanks

Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘display random posts on index.php instead of latest’ is closed to new replies.