Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to paginate an archive page. Pagination works perfectly fine for everything except tag/category archives. Basically if I use /tags/tag_name/?paged=2 it gives me a 404 error. But if I use /tags/tag_name/?page=2 it works fine. Unfortunately I need to use /tags/tag_name/?paged=2

I reckon it has to do with rewriting. These are the existing rules WP has:

tags/([^/]+)/page/?([0-9]{1,})/?$   index.php?tag=$matches[1]&paged=$matches[2] post_tag
tags/([^/]+)/?$ index.php?tag=$matches[1]   post_tag

I have tried all the combinations of rewrite rules I could think of to make /tags/tag_name/?paged=2 work. No success. How can I make it work?

===

What I found out it is only ?paged=2 that gives me trouble. /tags/tag_name/?abc=2 doesn't give a 404. Makes no sense to me.

===

ok, so what I decided to do is unset $_GET['paged'] in functions.php and set it's value back in header.php. Then I changed all the code to avoid using WP's get_query_var. Works for now.

share|improve this question
    
Why are you trying to create rewrite rules for tags, WordPress does that for you already. –  t31os Apr 30 '13 at 15:54
    
Try one time to save permalink in admin side.May it fix issue. –  Bindiya Patoliya Jul 18 at 7:08
add comment

3 Answers 3

I change the pagination param from "paged" to "page" and works! Dont give 404 more =)

share|improve this answer
    
Can you explain what you did in more detail, and explain why it solves the problem? –  s_ha_dum Apr 30 '13 at 4:10
add comment

Try changing the Blog pages show at most in settings->reading . This solved the problem I had with pagination which is almost the same.

share|improve this answer
add comment

A very simple way is to insert in your functions.php:

if ( isset( $_GET['paged'] ) )
    $_GET['page'] = $_GET['paged'];
share|improve this answer
    
that too gives me a 404. –  user1158010 Feb 17 '13 at 12:54
    
Can you paste the code of this file in the pastebin.com? –  Thiago Locks Feb 17 '13 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.