Skip to main content
added 71 characters in body
Source Link

try this code,

`get_header(); global $current_user; get_currentuserinfo();

if(is_user_logged_in()){ // content for login user } else { $url = 'http://example.com'; wp_redirect($url); exit(); } `

get_header();
global $current_user;
get_currentuserinfo();

if(is_user_logged_in()){
    // content for login user
} 
else {
$url = 'http://example.com';
wp_redirect($url);
    exit();
} 

try this code,

`get_header(); global $current_user; get_currentuserinfo();

if(is_user_logged_in()){ // content for login user } else { $url = 'http://example.com'; wp_redirect($url); exit(); } `

try this code,

get_header();
global $current_user;
get_currentuserinfo();

if(is_user_logged_in()){
    // content for login user
} 
else {
$url = 'http://example.com';
wp_redirect($url);
    exit();
} 
Source Link

try this code,

`get_header(); global $current_user; get_currentuserinfo();

if(is_user_logged_in()){ // content for login user } else { $url = 'http://example.com'; wp_redirect($url); exit(); } `