Support » Plugins » Hacks » Link to own's post on front end

  • I’ve got a site built where everything is done on the front-end. With the exception of admins, no one will ever see the dashboard, ever. But I want a link that someone can click that will allow them to see their own posts in a list style. So, the link for each person would basically be “ logged in user)/” It’s set up where they can edit their posts on the front end, but I can’t figure out how to make the link work. It’ll be going in the header and footer, so PHP is fine. It’ll be written into an if statement, wherein if the user is logged in, then several lnks will show, including this one I’m trying to build. If not, then the login and register buttons show. Does any of this make sense? Thanks!

Viewing 1 replies (of 1 total)
  • Try:

    if( is_user_logged_in() ) {
    	$id = get_current_user_id();
    	$url = get_author_posts_url( $id );
            echo '<a href="' . esc_attr($url) . '">My Posts</a>'

Viewing 1 replies (of 1 total)
  • The topic ‘Link to own's post on front end’ is closed to new replies.