WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sophia_o
    Member
    Posted 1 year ago #

    Hi!

    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...

    http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

  2. sophia_o
    Member
    Posted 1 year ago #

    Hi!

    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. Sabir Abdul Gafoor
    Member
    Posted 4 months ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic