glitch with PHP commands?
-
Hi;
I put this code at the top of my single.php file just below the <?php get_header(); ?> command but the site runs as if the code does not exist.
What am I doing wrong.
The purpose of the code is to check if an article belongs to the ‘private’ category and if a user is logged in. If not, the code must execute an other file, instead of loading up the article:
——- code I wrote —–
<?php
if ( is_category( ‘private’ ) ) && ( is_user_logged_in() ) {
get_currentuserinfo();
echo ‘Welcome: ‘ . $current_user->display_name . “\n”;
}else{
include ‘/members/’;
exit;
}
?>any suggestions would be much appreciated. Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘glitch with PHP commands?’ is closed to new replies.