wp query – Display if author page is author page of current user

Question

ok. here is my own soliton. but may be there are a better ways

 <?php 
    $currenuserid = get_current_user_id();
    $author = get_queried_object();
    $author_id = $author->ID;
    //echo $currenuserid;
    //echo $author_id;
        if ($currenuserid == $author_id){
        echo "belongs to current user ";
        }
    else {
    echo "not belongs to current user";
    }
    ?>

0
Teymur Abbasov 1 month 2022-06-03T12:23:07-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse