I've had a problem with this for quite some time now and cannot for the life of me figure it out. I am using Multi-site and not sure if that has anything to do with it or not, so keep that in mind.
When clicking on tags on a post or custom post type, I only get the default post count set by WP which is 10 posts as results. Pagination shows at the bottom for next post and older posts, but when I click on either link, page 2 is not found and it sends me to 404 page. There is a mix of regular posts and then custom posts types that should be showing, but regardless the post type, it only shows 10 even though there are hundreds.
At first I was using the Twentyten way of showings tags which was using
get_template_part() and redirecting to a loop.php page. I have sense eliminated that process and created my own tag.php page and use the default wordpress loop to query for posts.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
However I had to use this bit of code to query for all posts types and not just the regular ones.
global $wp_query; $args = array_merge( $wp_query->query, array( 'post_type' => array('post, cool_tools, tribe_events') ) ); query_posts( $args );
My pagination code for the page reads :
<div id="nav-below" class="navigation"> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> </div><!-- #nav-below -->
The url to the missing page is:
Can anyone tell me why WP wont find any more tags?
As per Chip's example, here is how I have it setup now.
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'post', 'tag_slug__and' => $tagname, 'paged' => $paged ); $query = new WP_Query($args); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
Yet when I click newer posts at the bottom, it still takes me to a 404 page and no page 2 found for tags.