Support » Fixing WordPress » get the author posts url link of Author Archive Page in WordPress

  • Resolved coolsaint

    (@coolsaint)


    function fix_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_canonical');

    functions.php under my current theme.

    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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get the author posts url link of Author Archive Page in WordPress’ is closed to new replies.