Add a link to display posts with a specific tag within a date range

Check out wp_get_archives().

As described by the Function Reference linked to above, “This function displays a date-based archives list. This tag can be used anywhere within a template.”

It gives several examples of how you can use the function, including if you wish to use a dropdown rather than listing every archive.

By default this function will take in to account every post, not just the ones about your author. However, you needn’t fear – there are hooks that you can use to fix this. For example, you can add a specific author –

On your template add this –

$args = array(
    'author' => $author_id,  // Obviously this relies on you knowing the ID of the author
    'type' => 'yearly'
)
wp_get_archives($args);

And then in functions.php

add_filter('getarchives_where', 'my_edit_getarchives_where');
function my_edit_getarchives_where($where, $args){

    if(isset($args['author']) :  // Ensure that an author has been specified
        $where.= ' AND `post_author` IN (' . $args['author'] . ')';
    endif;

    return $where;

}

Note that while auhor is not a default argument of the wp_get_archives() function, it won’t be stripped out and thus will be available for your custom use in a scenario such as that described above.

If that example doesn’t quite do it for you then there are two other filter hooks that you can use

  • getarchives_join – Allows you to JOIN additional tables (so that you can link to archives of a certain category/tag).

  • the_title – You can amend the title output if you wish (place ‘Archive – ‘ before it, for example). Not much help in your situation, but good to know about.

I’d encourage you to look through the function in question to fully understand how it works. wp_get_archives() can be found in /wp-includes/general-template.php on line 1321 (I’m using version 4.1).