Hook template_redirect
and check if it’s a category archive page, if so get the category ID from query_vars
and query_posts
for a single post from that category, which by default should be the most recent, then wp_redirect
to the post’s permalink.
This code would go in your theme’s functions.php
file:
function my_category_redirect() {
if ( is_category() ) :
query_posts('cat=". get_query_var("cat') .'&posts_per_page=1');
wp_redirect( get_permalink() , 301 );
exit;
endif;
}
add_action( 'template_redirect', 'my_category_redirect' );