Skip to content

Instantly share code, notes, and snippets.

@kachi
Created March 11, 2012 06:39
Show Gist options
  • Select an option

  • Save kachi/2015327 to your computer and use it in GitHub Desktop.

Select an option

Save kachi/2015327 to your computer and use it in GitHub Desktop.
<ul>
<li><h2>ランダム記事</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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment