is_admin function is not working for me in WordPress

Hello I am not sure why
is_admin

is not Working for me.
Here is my code.

Read More
if($featuredADS == "0" || $availableADS == "0" || empty($result) && $countPosts >= $postLimitperUser && $postLimitOn == 1 && !is_admin()){
//Some Code here
}else{
//Some Code here Which is always Work for admin
}

I want to ignore this check for admin user. If user is admin then i want to run code from (else).

Related posts

2 comments

  1. $is_admin = current_user_can('manage_options');  // all user they have mange option will get 
    
    if ($is_admin) {
        echo "admin"
    }
    else
    {
        echo "not admin"
    }
    

Comments are closed.