By displaying random post in blog you can show blog visitors all your old posts.This will increase page views and your old articles comes to light. 😉 For easy access to old articles display random posts in sidebar or in footer. Using more plugins in blog will reduce its speed.So, I will show how you can display random posts in your WordPress blog without using any pulgin. 🙂
Goto Dashboard –> Appearance –> Editor and open sidebar.php, just copy and paste the following code:
<li><h3>Random Post</h3>
<ul>
<?php $posts = get_posts(‘orderby=rand&numberposts=5’); foreach($posts as $post) { ?>
<li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a>
</li>
<?php } ?>
</ul>
</li>
Note:
If you want to display more than 5 posts, simply change the number 5 to the number of your choice.Very easy…Isn’t it? 🙂
thank you for helping mate… as using plugins may slow down the blog so, prefer using your method…