If logged in user views his profile page
You can make use of the get_current_user_id(), get_the_author_meta(‘ID’), and get_edit_user_link() functions. Take the below snippet for instance: if( get_current_user_id() === get_the_author_meta(‘ID’) ){ printf( ‘<a href=”https://wordpress.stackexchange.com/questions/314019/%s”>Edit Profile</a>’, get_edit_user_link() ); } get_current_user_id() will return int(0) if nobody is logged in, or the integer ID of the current user. This effectively removes the need for is_user_logged_in(). get_the_author_meta(‘ID’) will … Read more