WordPress.org

Ready to get started?Download WordPress

Forums

elseif (is_author()) not returning in archive.php (1 post)

  1. Hans Magnus Mikalsen Nedreberg
    Member
    Posted 7 years ago #

    Below line 2 in archive.php:
    <?php if (have_posts()) : ?>

    I have something like
    <?php /* If this is a author archive */ } elseif (is_author()) { ?>
    <h3 class="pageTitle">Posts from <?php the_author(); ?></h3>

    However, this doesn't output anyhing. If I change <?php the_author(); ?> to <?php the_time(); ?>, the time of first archived post is displayed. the_category works too the_title, but not the_author.

    If "the_author" is placed within the <?php while (have_posts()) : the_post(); ?> loop, it returns correctly.

    How can I get around this?

    Thanks!

    Kind regards
    Hans Magnus

Topic Closed

This topic has been closed to new replies.

About this Topic