In my site's sidebar, I have a list of the 10 latest posts. I'd like to add a link at the bottom to "Show More Posts" and "Show Less Posts" when clicked.
For example: Go here
On the right sidebar, scroll down to "Archives". The "See All Archives" / "Hide Archives" feature is what I'd like to create, but using the latest post titles (w/ links) rather than an archive.
Anyone know of a jQuery or similar plugin that can handle this feature?
This is the code I'm currently using to display the latest 10 posts:
<?php
wp_reset_query();
if (is_single()) { ?>
<span class="latest">Latest Posts</span>
<ul class="blogroll">
<?php $myposts = get_posts('numberposts=10&category=-3');
foreach($myposts as $post) :?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li>
<?php endforeach; ?>
</ul>
<?php } ?>