Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 349d019923
Fetching contributors…

Cannot retrieve contributors at this time

executable file 19 lines (17 sloc) 0.718 kb
<?php /*
Example template: random
This template gives you some random other post in case there are no related posts
Author: mitcho (Michael Yoshitaka Erlewine)
*/ ?>
<h3>Related Posts</h3>
<?php if ($related_query->have_posts()):?>
<ol>
<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><!-- (<?php the_score(); ?>)--></li>
<?php endwhile; ?>
</ol>
<?php else:
$related_query->query("orderby=rand&order=asc&limit=1");
$related_query->the_post();?>
<p>No related posts were found, so here's a consolation prize: <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>.</p>
<?php endif; ?>
Jump to Line
Something went wrong with that request. Please try again.