Running loop when logged in
-
Hi,
Is it possible to only have the loop run if a user is logged in?
For example, something like this:<?php if ( is_user_logged_in() { ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
etc.
Basically I have a category.php file for a specific category, but I only want the posts displayed if a user is logged in. I tried this a few different ways, but am not sure if it’s just my syntax that is wrong, or if it’s just not possible to do.
Anyone able to shed any light?Cheers
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Running loop when logged in’ is closed to new replies.