ok. hereThe is_author()
conditional can be used to check if the query is my own solitontargeting an author's page. but mayBy passing one or more User IDs/nicenames into it, it will check for specific author pages. So to check if the current author page is for the current user, it can be there are a better wayspassed the return value from get_current_user_id()
:
<?php
$currenuserid = get_current_user_id();
$author = get_queried_object();
$author_id = $author->ID;
if ($currenuserid == $author_id){
echo "belongs to current user ";
}
else {
echo "not belongs to current user";
}
?>
if ( is_user_logged_in() && is_author( get_current_user_id() ) ){
echo "belongs to current user ";
}
else {
echo "not belongs to current user";
}