Feed on

to get a random post from your wordpress blog, use this little php snippet:

$rand_posts = get_posts(‘numberposts=1&orderby=rand’);
foreach( $rand_posts as $post ) :
<a href=”<?php the_permalink(); ?>”>Chance</a>
<?php endforeach; ?>

Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS