Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
if (!function_exists('get_rand_permalink')):
function get_rand_permalink()
if($posts = get_posts(array('posts_per_page' => 1, 'orderby' => 'rand')))
$post = current($post);
return get_permalink($post->ID);
return home_url();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment