hi, i just found this forum via google, and it looks like you guys are trying to do the same thing i am.
i have a sidebar that i call on my category archive pages, and single post pages, that pulls in all the post titles from the 20 most recent posts.
it has a serious problem though. for some reason, when i include it, all post links, and all links within the sidebar link to the most recent post only, even though the urls are correct for each specific link.
perhaps someone know what i'm doing wrong.
here's the code for sidebarright.php
PHP Code:
<div id="sidebarright">
<?php global $post; $categories = get_the_category(); foreach ($categories as $category) : ?>
<h3>Previous posts:</h3>
<ul>
<?php $posts = get_posts('numberposts=20&category='. $category->term_id); foreach($posts as $post) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<li>View the full archive for<a href="<?php echo get_category_link($category->term_id);?>" title="View all posts filed under <?php echo $category->name; ?>"> <?php echo $category->name; ?> »</a></li>
<?php endforeach; ?>
</ul>
</div>
the site i'm working on is:
www.lgtrippgallery.com
thanks!