WordPress custom sidebar category filtered archive code

<div id=”sidebar”>
<ul>
<?php
$myposts = get_posts(“category=1”);
foreach($myposts as $post) : ?>
<li><a href=”<?php the_permalink(); ?>“><?php the_time(‘M’) ?>. – <?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>

mostly in thanks to:

http://www.z-oc.com/blog/2008/03/category-based-archive/

http://www.themightymo.com/2009/07/22/includeexclude-category-from-wordpress-wp_get_archives/

http://kwebble.com/blog/2007_08_15/archives_for_a_category

Leave a Reply

You must be logged in to post a comment.