[wp-trac] [WordPress Trac] #3345: Allow author.php to show even if
author has 0 posts.
WordPress Trac
wp-trac at lists.automattic.com
Wed Nov 8 22:56:40 GMT 2006
#3345: Allow author.php to show even if author has 0 posts.
----------------------+-----------------------------------------------------
Reporter: ruckerz | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.1
Component: Template | Version: 2.0.4
Severity: normal | Keywords: author no posts
----------------------+-----------------------------------------------------
Loading /author/username will return a 404 if author has no posts. It is
desirable to show something, in my case, author profiles and let
author.php decide what to do if the author has 0 posts.
Rewrote handle_404() to...
if ( (0 == count($wp_query->posts)) &&
(!isset($wp_query->query_vars['cat']) || $wp_query->query_vars['cat']== 0)
&& (!isset($wp_query->query_vars['author']) ||
$wp_query->query_vars['author'] == 0) && !is_404() && !is_search() && (
$this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false ===
strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
Note this includes patches from Trac #1969 (Check for category and author
page existence) and also solves final comment by _ck_.
--
Ticket URL: <http://trac.wordpress.org/ticket/3345>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list