WordPress.org

Ready to get started?Download WordPress

Forums

How to sort random posts by date? (3 posts)

  1. MTV
    Member
    Posted 4 years ago #

    Is it possible to display random posts within 30 and omit duplicate post?

    <ul><li><h2>Random Posts</h2>
        <ul>
     <?php
     $rand_posts = get_posts('numberposts=5&orderby=rand');
     foreach( $rand_posts as $post ) :
     ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
     <?php endforeach; ?>
        </ul>
     </li></ul>

    Thank

  2. Shane G
    Member
    Posted 4 years ago #

  3. MTV
    Member
    Posted 4 years ago #

    Great plugins Shane but it doesn't give me an option to sort the date.

Topic Closed

This topic has been closed to new replies.

About this Topic