Skip to content

Instantly share code, notes, and snippets.

@gabrielcesar
Created May 12, 2015 19:54
Show Gist options
  • Save gabrielcesar/fc3b813dfc157a1a093b to your computer and use it in GitHub Desktop.
Save gabrielcesar/fc3b813dfc157a1a093b to your computer and use it in GitHub Desktop.
<!--
wordpress_random.php
-->
<li>
<ul>
<?php
$posts = get_posts ( 'orderby=rand&numberposts=5' );
foreach ( $posts as $post )
{
?>
<li><a href="<?php the_permalink (); ?>"><?php the_title (); ?></a></li>
<?php
}
?>
</ul>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment