I'm confused. I wrote the following script for a project awhile back that pulled and listed movies within a certain genre (category). I copied the code but what's happening is it's linking to the front page of the category. It lists the sub cats but the permalinks are all the same. Hopefully someone can help with the code below OR possibly provide a better solution for listing posts under a specific category.
code:
<div class="menu">
<?php $posts = get_posts( "category=" . 2 . "&numberposts=2" ); ?>
<?php if( $posts ) : ?>
<a href="#aboutus" class="menuitem top">Action</a>
<div class="menu">
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>" class="menuitem"><?php the_title(); ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
thx
rob