I am attempting to create an archives page that would have links to authors, categories, tags, etc. I would like it so that when the author, for example, is clicked, all their posts are displayed. Currently, if you go to http://diginomics.com/archive/ you see that clicking the link only brings you back to the archive page, essentially creating a loop.

This is my current code for the archive page template archive.php:

    <?php the_post(); ?>

    <h3>Posts by author:</h3>

    <?php $args = array(
        'orderby'       => 'name', 
        'order'         => 'ASC', 
        'number'        => null,
        'optioncount'   => false, 
        'exclude_admin' => true, 
        'show_fullname' => false,
        'hide_empty'    => true,
        'echo'          => true,
        'style'         => 'list',
        'html'          => true ); ?>

        <?php wp_list_authors( $args ); ?>

    <h3>Archive by month:</h3>

        <?php wp_get_archives('type=monthly'); ?>

    <h3>Archive by category:</h3>

         <?php wp_list_categories( 'title_li=' ); ?>

    <h3>All posts alphabetically:</h3>

        <?php wp_get_archives('type=alpha'); ?>

    <h3>Tag cloud:</h3>

        <?php wp_tag_cloud(); ?>

What am I doing wrong and what do I need to change to get the desired effect?

1 Answer 1


Don't name your custom page template archive.php. If you refer to the Template Hierarchy, you'll see that archive.php is the template WordPress loads for archives if a more specific template isn't available.

  • Followed this advice which seemed to work well enough, but now when I click on a specific author to look up, I get some random post before the results. Check it out and you will see what I mean. Code remains the same. Commented Dec 24, 2014 at 5:31
  • I can't explain that without seeing your templates. Look at the template hierarchy, figure out what template your author archives is loading, and look at the code for that particular template.
    – Milo
    Commented Dec 24, 2014 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.