It’s working for me. What’s the code look like for your “trigger”?
if(is_author()) {
// Do blah blah
}
I am calling it in a function which is hooked to template_redirect.
At the same location other functions like is_date() or is_single() etc. are working.
And I am calling an author page by:
http://hostname/index.php/author/0/
or
http://hostname/index.php?author=0
In fact is_author() is also not working in a template. As you like code here it goes:
if(is_author()) {
echo ‘I am in Author Archive’;
}
Uh, nope. No problem here with is_author() under any of those conditions. Could the issue be related to passing the author value of 0? That should be considered an invalid ID.
Thanks. That works 🙂
BTW: I actually used zero (0). Shouldn’t that work too?
“I actually used zero (0). Shouldn’t that work too?“
Beyond the fact WordPress doesn’t provide 0 for an user ID? Well, it runs into the same issue something like ?page_id=0 would, which is in such a query you’re actually passing a null value. When that happens WP assumes no query has taken place, and just uses the default query (which would be the home page).
Thanks for the clarifications.
Wish you a Happy New Year.