3 added 113 characters in body
source | link

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
$th = $curauth->nickname; 
$cu = $current_user->user_login;
if ( $th = $curauth ) {
  edit_post_link('edit', '', ''); 
} else {

}

but still only admins can see the links.

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$th = $curauth->nickname; 
$cu = $current_user->user_login;
if ( $th = $curauth ) {
  edit_post_link('edit', '', ''); 
} else {

}

but still only admins can see the links.

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
$th = $curauth->nickname; 
$cu = $current_user->user_login;
if ( $th = $curauth ) {
  edit_post_link('edit', '', ''); 
} else {

}

but still only admins can see the links.

2 corrected code formatting
source | link

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$th = $curauth->nickname; $cu = $current_user->user_login; if ( $th = $curauth ) { edit_post_link('edit', '', ''); } else { }

$th = $curauth->nickname; 
$cu = $current_user->user_login;
if ( $th = $curauth ) {
  edit_post_link('edit', '', ''); 
} else {

}

but still only admins can see the links.

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$th = $curauth->nickname; $cu = $current_user->user_login; if ( $th = $curauth ) { edit_post_link('edit', '', ''); } else { }

but still only admins can see the links.

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$th = $curauth->nickname; 
$cu = $current_user->user_login;
if ( $th = $curauth ) {
  edit_post_link('edit', '', ''); 
} else {

}

but still only admins can see the links.

1
source | link

Display edit link if post author is current user

I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user

for example

if testuser is logged in and current page is /author/testuser he can see edit post links

but

if testuser is logged in and current page is /author/theee he cant see the links

currently i have

$th = $curauth->nickname; $cu = $current_user->user_login; if ( $th = $curauth ) { edit_post_link('edit', '', ''); } else { }

but still only admins can see the links.