[wp-hackers] Should Monthly Archive Pages ever return 404?

scribu scribu at gmail.com
Tue Mar 10 22:39:38 GMT 2009

On Wed, Mar 11, 2009 at 12:18 AM, Ade Walker <photofantaisie at gmail.com>wrote:

> Perhaps I'm missing the point completely, but if the loop in the relevant
> theme template file simply includes an "else", eg this (much simplified,
> just to illustrate the point)...
> if (have_posts) : while (have_posts etc etc
> // Post content
> endwhile; else :
> // "There are aren't any posts this month. I was too lazy to write one!"
> endif;
> Then no 404, and something reasonably useful is communicated to the user -
> who then might be tempted to click on a real link in the sidebar etc. In
> other words, it seems to me a template issue rather than anything
> fundamentally flawed with how WP handles queries. Just my two centimes
> worth. :-)
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

That's not how it works. I've seen several themes that have an else and
still return a 404. The code in the else branch is never executed actually,
so I just delete it.


More information about the wp-hackers mailing list