Allow PHP in Posts and Pages
hide content unregistered users (3 posts)

  1. sophia_o
    Posted 2 years ago #


    I would like to hide some content from unregistered users but do not get the syntax right... Would be very thankful for your help!!

    I would like something like this with the php plugin:

    <?php if ( bb_is_user_logged_in() ) : ?>
    HTML content for registred user
    <?php else : ?>
    HTML content for unregistred user
    <?php endif; // bb_is_user_logged_in() ?>

    I tried [php] if....[/php] and [php if ... /php] and other versions, but do not understand how to use it...


  2. sophia_o
    Posted 2 years ago #


    Anybody out there who can tell me what is wrong with this code or how the code should look like?

    [php] if ( is_user_logged_in() ) : [/php]
    HTML content for registered users
    [php] else : [/php]
    HTML content for unregistered users
    [php] endif; // is_user_logged_in() [/php]

  3. Sabby
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Allow PHP in Posts and Pages
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic