I use this to call posts:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$per_page = get_option('to_count_archives');
query_posts("posts_per_page=".$per_page."&paged=".$paged."&cat=".$cat);
if (have_posts())
?>
<?php while (have_posts()) : the_post(); ?>
And it works great for categories. But on archives pages generated for tags it shows ALL posts, not just posts with a specific tag. I am going to creates a separate archives.php and category.php.
I need to keep the to_count_archives part of the code because it calls the number of posts per page.
I appreciate any help rewriting the code above to work correctly.