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 have a custom query in category-slug.php, which works fine unless the category doesn't have that number of pages itself.

If the category only has 5 pages of posts, but the query I put in has 7, it'll show 404 for pages 6 and 7.

Pretty sure the reason for this is that category-slug.php checks to see if there is a page for that category before it gets to the query I have in the file.

Is there a way for me to force it to run the page instead of showing a 404?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I've not tested this, but adding an action after parse_query or wp which checks if the current request is_category(), and then setting the is_404 property of the global $wp_query to false might set you off in the right direction.

share|improve this answer

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.