WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help! Pagination issue with Tags (2 posts)

  1. squeaker2
    Member
    Posted 3 years ago #

    Thanks to Esmi for his last snippet of code on my last issue with category... worked like a charm! Now, I thought I could apply the same logic with tags... but no such luck. Pretty much the same issue, but now with tags and I don't understand why this wont work, it is the exact same concept.

    <?php if (isset($_GET['searchCat'])){
    			$myCAT = $_GET['searchCat'];
    			$hideheader = 'true';
    			$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    			query_posts('category_name='.$myCAT.''.'&posts_per_page='.$limitPagePosts.'&paged=' . $paged);
    			}
    			else if (isset($_GET['tag'])){
    			$myTAG = $_GET['tag'];
    			$hideheader = 'true';
    			$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    			query_posts('tag='.$myTAG.''.'&posts_per_page='.$limitPagePosts.'&paged=' . $paged);
    			}
    			else { query_posts($query_string.'&posts_per_page='.$limitPagePosts.'');}
    		?>
    		<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    
    LOOP CODE
    
    <?php endwhile; ?>
    
    		<?php endif; ?>

    Once again.. pagination determines the correct amount of posts attached to the tag, but when I click page 2... I get a Yahoo 404 error. Any ideas why this same logic won't work? The category code works flawlessly. Weird.

  2. squeaker2
    Member
    Posted 3 years ago #

    To solve this, I just changed tag to tagged... WP uses tag for itself.. i just used a custom variable and said screw it :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.