Posted By

DanielPaul on 08/16/10


Tagged

plugin wordpress random posts


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

ariunbolor
manavecplan
mikoli
athanassiadis
laurentzziu
marclarr


Wordpress random posts


 / Published in: PHP
 

Display random posts without a plugin

  1. <ul>
  2. <?php $rand_posts = get_posts('numberposts=5&orderby=rand');
  3. foreach( $rand_posts as $post ) : ?>
  4. <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
  5. <?php endforeach; ?>
  6. </ul>

Report this snippet  

You need to login to post a comment.