Viewing 6 replies - 1 through 6 (of 6 total)
  • Maybe you can use the function that is already in WP when for example the admin navigation buttons are showing depending on if you’re logged in or not?

    Thread Starter atencion

    (@atencion)

    That´s a good idea, fredrik. Thanks for replying.

    I¨m there, looking for some function wich might be useful but to be honest I´m quite lost and I´m not finding anything that I could tell it´d work.

    Do you have any idea on what exactly to look for? I´m guessing is some sort of conditional, but I don´t really know.

    Thread Starter atencion

    (@atencion)

    Thank you very much!…
    I think I´ve figured it out …at least it´s working..

    I just check if the $user_ID string has nothing ..

    Here´s how..

    <?php
    if ($user_ID==”) {
    ?>

    “SHOW SOMETHING FOR NON-REGISTERED USERS HERE”

    <?php
    } else {
    ?>
    “SHOW SOMETHING FOR REGISTERED USERS HERE”

    <?php
    }
    ?>

    Correct code would be:

    if (!$user_ID) {

    Alternatively,
    if (empty($user_ID)) {

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘How do i know when someone is logged in?’ is closed to new replies.