Site icon Hip-Hop Website Design and Development

Redirect Customers who aren’t logged in, aren’t publish authors and are not admin. Frontend

Very new to PHP and I am attempting to do the next via a snippets plugin however preserve getting essential errors:

I’ve tried with plugins however nothing fairly provides me what I would like,

Any assist is far appreciated, code beneath:

add_action( 'template_redirect', 'redirect_non_permitted_users' );

perform redirect_non_permitted_users () {
     $userID = get_user_id();
     $authorID = get_the_author_meta(ID);

    if(current_user_can('manage_options')){
 
    }

    elseif( $userID <> $authorID || ! is_user_logged_in() || ! is_front_page() || ! is_page('about') || ! is_page('pricing')){
        wp_redirect('https://www.instance.com/no-permission/'); 
    exit;
    }   
}