Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#3346 closed defect (bug) (duplicate)

Allow author.php to show even if author has 0 posts.

Reported by: ruckerz Owned by: anonymous
Priority: normal Milestone:
Component: Template Version: 2.0.4
Severity: normal Keywords: author no posts
Cc:

Description

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_varscat?)
$wp_query->query_varscat?== 0) && (!isset($wp_query->query_varsauthor?) $wp_query->query_varsauthor? == 0) && !is_404() && !is_search() && ( $this->did_permalink (!empty($_SERVERQUERY_STRING?) && (false === strpos($_SERVERREQUEST_URI?, '?'))) ) ) {


Note this includes patches from Trac #1969 (Check for category and author page existence) and also solves final comment by _ck_.

Change History (2)

  • Resolution set to duplicate
  • Status changed from new to closed
  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.