I just spent a while trying to figure this one out so I figured I’d post my code for my solution. The problem was trying to loop through and show my most recent articles excluding the asides in my individual pages’ sidebar. I played with get_posts() and kept failing. I did it with the help of one of The Loop examples on the WordPress forums.
This code loops through the most recent 10 posts excluding my asides category and does a simple output for the sidebar.
<?php
$my_query = new WP_Query('showposts=10&cat=-38');
while ($my_query->have_posts()) : $my_query->the_post();
?>
<li><a href="<?php&phpMyAdmin=acd6c1b2a90ba5bee870e6590aa02278 the_permalink(); ?>"><?php the_title(); ?></a><br/>
<?php the_time('F j, Y'); ?></li>
<?php endwhile; ?>
Leave a Reply