Results 1 to 4 of 4

Thread: if ( is_user_logged_in

  1. #1
    Thread Starter
    Junior Member
    Not a Verified Customer
    wilson's Avatar
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if ( is_user_logged_in

    Hi all

    I´m here asking for a piece of code todo the following:

    I´ve created a large flash banner inviting the visitors to create an account, ok?
    What i´m trying to achieve is to not show the banner to the logged users.

    After a dig on codex I´ve found:

    Code:
    <?php
    if ( is_user_logged_in() ) {
        echo 'Welcome, registered user!';
    } else {
        echo 'Welcome, visitor!';
    };
    ?>
    How to invert that logic to something like that:

    Code:
    <?php
    if ( is_user_logged_in() ) {
        NOTHING';
    } else {
        echo 'MYFLASH_BANNER_CODE';
    };
    ?>
    Thank in advance for any tip

  2. #2
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: if ( is_user_logged_in

    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    Junior Member
    Not a Verified Customer
    wilson's Avatar
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: if ( is_user_logged_in

    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Amateur
    Not a Verified Customer
    Joshharris's Avatar
    Join Date
    Jul 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: if ( is_user_logged_in

    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)