• Resolved aminabbasian

    (@aminabbasian)


    Is it possible to manually link to a author page depending on which user is logged in?

    Once a user is logged in and I would like a link to appear which will take them to their own author page.

    I’m currently trying to edit the Sidebar Login Plugin From:

    $link[0] = str_replace('%userid%',$current_user->ID,$link[0]);
    echo '<li class="page_item">'.$link[0].'</li>';

    to

    $link[0] = str_replace('%userid%',$current_user->ID,$link[0]);
    echo '<li class="page_item"><a href="https://www.ceativityds.com/admin/$curauth">'.Profile.'</a></li>';
    echo '<li class="page_item">'.$link[0].'</li>';

    But I am currently stuck with: echo '<li class="page_item"><a href="https://www.ceativityds.com/admin/$curauth">'.Profile.'</a></li>';

    Any idea how I can edit this?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter aminabbasian

    (@aminabbasian)

    bump

    here is some sample code to display the an author link

    function authorLink() {
    if (is_user_logged_in())  {
    global $user_identity;
    get_currentuserinfo();
    return '<a>View Your Posts/Custom Posts</a>' ;
    }else {
    return '';
    }
    }
    add_shortcode('authorLink', 'authorLink');
    
    function add_pagination_to_author_page_query_string($query_string)
    {
        if (isset($query_string['author_name'])) $query_string['post_type'] = array('post','a_custom_post_type');
        return $query_string;
    
    }
    add_filter('request', 'add_pagination_to_author_page_query_string');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Manually Link to Author Page’ is closed to new replies.