WordPress: don't show 404 when no posts exist

Posted by philfreo on Stack Overflow See other posts from Stack Overflow or by philfreo
Published on 2010-01-06T16:18:37Z Indexed on 2010/06/12 16:42 UTC
Read the original article Hit count: 286

Currently there is a bug in WordPress if you have a Posts Page set under:

Settings->Reading->A Static Page->Posts Page

If there are posts, than the page (e.g. with a slug called news) displays the post, and uses index.php from the theme.

But, with this configuration, if there are no posts, then it calls the theme's 404 page. This is definitely a bug, and has been submitted (Ticket #10822). It should be letting index.php show whatever it wants upon !have_posts(), but right now the page doesn't seem to be called at all.

My question is: is there a workaround for this bug without modifying core wp files? I'd be open to a plugin, theme changes, a custom page template, htaccess changes, etc.

© Stack Overflow or respective owner

Related posts about php

Related posts about Wordpress