Support » Fixing WordPress » elseif (is_author()) not returning in archive.php

  • 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?


    Kind regards
    Hans Magnus

  • The topic ‘elseif (is_author()) not returning in archive.php’ is closed to new replies.