Skip to content

Instantly share code, notes, and snippets.

@clintonhalpin
Created August 11, 2012 20:50
Show Gist options
  • Save clintonhalpin/3327229 to your computer and use it in GitHub Desktop.
Save clintonhalpin/3327229 to your computer and use it in GitHub Desktop.
Determine if users logged in, Serve different content
<?php
/*
Determine User Status and Change Content based on login
*/
get_currentuserinfo();
global $user_ID, $user_login;
//Not Logged In go where ever
if ($user_ID == '') {
header('Location: /'); exit();
}
//Admin = See All
elseif($user_ID == '1'){
$user_content = '';
}
//Logged In User
else {
$user_content = $user_login;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment