Sometimes new visitors will visit your blog and only see the most recent articles. I believe its a good idea to give the readers some older articles that you’ve written. Along with discovering more content on your site, inserting a random post on the sidebar will increase page views.
To add random posts to your sidebar go to Appearance–>Editor–>sidebar.php. Then, insert the following code:
<li><h2>Random Post</h2>
<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>
To change the number of posts the code displays, just change the blue # to how many posts you want.



Thu, Jan 7, 2010
Website Design, WordPress