I’m wondering how I can show recent posts from the same taxonomy as the post that’s currently being viewed (working with custom post types and custom taxonomies).
If it was simply a category of a regular post, it would look like this:
<?php global $post;
$categories = get_the_category();
foreach ($categories as $category) :
?>
<h3>More News From This Category</h3>
<ul>
<?php
$posts = get_posts('numberposts=20&category='. $category->term_id);
foreach($posts as $post) :
?>
<li><a href="https://wordpress.stackexchange.com/questions/39455/<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<li><strong><a href="<?php echo get_category_link($category->term_id);?>" title="View all posts filed under <?php echo $category->name; ?>">ARCHIVE FOR '<?php echo $category->name; ?>' CATEGORY »</a></strong></li>
<?php endforeach; ?>
</ul>
But with custom posts/taxonomies, there has to be a different sort of solution. Couldn’t find anything useful so far in the wordpress codex.