function fix_meta_canonical() {
global $paged;
if (is_category()) {
$catid = get_query_var('cat');
echo '
<link rel="canonical" href="'.get_category_link($catid).'" />
<meta name="description" content="'.$meta.'" />';
if ($paged > 1) echo '
<meta name="robots" content="noindex,follow" />';
} else {
echo '';
}
if (is_tag()) {
$tagid = get_query_var('tag_id');
echo '
<link rel="canonical" href="'.get_tag_link($tagid).'" />';
if ($paged > 1) echo '
<meta name="robots" content="noindex,follow" />';
} else {
echo '';
}
}
add_action('wp_head', 'fix_meta_canonical');
functions.php
As you can see i have got the root permalink for the category and tag archives in the code. Now I want to get the archive link for authors. How can I do it?