• is_author() function is broken in WP 2.0. It doesn’t trigger on author pages.

    Is the issue known / being fixed?
    Any patch available?

Viewing 7 replies - 1 through 7 (of 7 total)
  • It’s working for me. What’s the code look like for your “trigger”?

    Thread Starter angsuman

    (@angsuman)

    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:
    https://hostname/index.php/author/0/
    or
    https://hostname/index.php?author=0

    Thread Starter angsuman

    (@angsuman)

    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.

    Thread Starter angsuman

    (@angsuman)

    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).

    Thread Starter angsuman

    (@angsuman)

    Thanks for the clarifications.
    Wish you a Happy New Year.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘is_author function broken’ is closed to new replies.