WordPress.org

Forums

[resolved] is_user_logged_in (3 posts)

  1. Steven Jones
    Member
    Posted 6 years ago #

    I have some code - what it should do is, if the user is not logged in and it's category 97 then you should get the member message. If they are logged in then they'll get the content.

    <?php if !(is_user_logged_in()) && (in_category('97')) { ?>
    You'll need to be a member to view this content.
    <?php } else { ?>
    <?php the_content(); ?>
    <?php } ?>

    What am I doing wrong?

    Cheers,
    Steve

  2. chaoskaizer
    Member
    Posted 6 years ago #

    find

    <?php if !(is_user_logged_in()) && (in_category('97')) { ?>

    replace with

    <?php if ( (!is_user_logged_in()) && in_category('97')  ) { ?>
  3. Steven Jones
    Member
    Posted 6 years ago #

    Thank you very much for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic