
Here is simple but useful WordPress code to show latest posts on your sidebar. Code written by catswhocode.com. How to use this code? Just open up the sidebar.php file and insert the following code to display the four latest posts in an unordered list…
WP: Show latest posts in the sidebar
Here is simple but useful WordPress code to show latest posts on your sidebar. Code written by catswhocode.com. How to use this code? Just open up the sidebar.php file and insert the following code to display the four latest posts in an unordered list:
<?php query_posts(’showposts=4′); ?>
<ul>
<?php while (have_posts()) : the_post(); ?>
<li><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
How to show more or less latest posts in sidebar?
<?php query_posts(’showposts=4‘); ?> where is 4 insert how much posts you want to see in your sidebar.
Source: CatsWhoCode
















2 Responses
It’s the first time I commented here and I must say you share us genuine, and quality information for bloggers! Good job.
p.s. You have a very good template for your blog. Where did you find it?
Thanks for your opinion. This theme for me isn’t so good. However this is Arthemia edited by me. You can download it from http://michaelhutagalung.com/2008/05/arthemia-magazine-blog-wordpress-theme-released/ for free.