Support » Themes and Templates » Author Name Isn't Showing Up in Archives

  • I’m having a problem with my archive.php file. Everything displays as I want it to except for the author’s name. For example, if I click on the category “Videos” the heading will be “Archives for Videos.” Likewise if I select a month. However, when I choose an author it says “Written by” and just leaves the author’s name blank. It doesn’t display. I can’t seem to find the issue in the relevant code:
    <?php if (is_category()) { ?><h2 class=”arh”><?php _e(‘Archive for’, ‘themezee_lang’); ?> <?php echo single_cat_title(); ?></h2>
    <?php } elseif (is_date()) { ?><h2 class=”arh”><?php _e(‘Archive for’, ‘themezee_lang’); ?> <?php the_time(‘F Y’); ?></h2>
    <?php } elseif (is_author()) { ?><h2 class=”arh”><?php _e(‘Written by’, ‘themezee_lang’); ?> <?php the_author(); ?></h2>
    <?php } elseif (is_tag()) { ?><h2 class=”arh”><?php _e(‘Tag Archive for’, ‘themezee_lang’); ?> <?php echo single_tag_title(”, true); ?></h2>
    <?php } elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?><h2 class=”arh”><?php _e(‘Archives’, ‘themezee_lang’); ?></h2><?php } ?>

    I’ve messed with the author section in every way I could think of, but the best I could do was echo the author number. Any help would be greatly appreciated.

Viewing 1 replies (of 1 total)
  • have a look into author.php of Twenty Eleven – how they are doing it:

    it seems that you need to get the fisrt post in the archive to get access to the author information.

Viewing 1 replies (of 1 total)
  • The topic ‘Author Name Isn't Showing Up in Archives’ is closed to new replies.