Hiding text when someone logs in!!

by LeonT
2 replies
Hello,

I am using thesis theme and I have the wishlist membership software installed.

I would like the text on homepage (above posts) to disappear only when someone logs in.

here is a code I was recommended but it doesn't seem to work for me:
<?php if (!is_user_logged_in() ) {
Text here..

}
?>


Any help would be appreciated
Thanks
#hiding #logs #text
  • Profile picture of the author Shounak Gupte
    does it return you any error or it simply doesnt work?
    Signature
    Looking for a quality but affordable graphic designer to partner with. To express your interest PM me with some samples.
    {{ DiscussionBoard.errors[2354761].message }}
  • Profile picture of the author Peter Olson
    Try something like this instead:

    <?php if ( is_user_logged_in() != TRUE ) { your text here... } ?>


    or try an if/else:

    <?php
    if ( is_user_logged_in() ) {
    echo
    'Welcome, registered user!';
    } else {
    echo
    'Welcome, visitor!';
    };
    ?>

    I got that from http://codex.wordpress.org/Function_...user_logged_in
    {{ DiscussionBoard.errors[2354973].message }}

Trending Topics