Hi guys,
I have been busy with exams during last few weeks. That’s why I haven’t been here for a long….
Anyway, I am trying to create a “Random post/page’ link for my site. Read few tutorials on WP and other sites on how to do it. They recommended using a custom page template with the rand function like the following and then assigning that page template to a page.
<?php
query_posts(array('orderby' => 'rand', 'showposts' => 1));
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<?php the_content(); ?>
<?php endwhile;
endif; ?>
My question is, is there a way to create a random posts link on Graphene Child theme without creating a whole new page template? Thanks.