• In one of the ‘Text’ widget I would like to input an image something like pic1 to show to not logged in users (guest) but when someone logs in they will see pic2 (for logged in users only) of which guests will not have access to. (of course, pic1 will not be needed to be shown to registered users)

    So in a sense, it would be…

    <if>if you’re NOT logged in
    <img src=”pic1″>
    <else>
    <img src=”pic2″>
    </if>

    If someone could code it this simple thing which I do not have the skillz to do myself, I’d appreciate it.

    TIA

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter skiorski

    (@skiorski)

    Would something like this work?

    <?php global $userdata;
    get_currentuserinfo();
    if ( ! $userdata->user_login ) { ?>
    <img src=”pic2″>
    <else>
    <img src=”pic1″>
    <?php }?>

    I’m not sure. I need coders to look at it and give advice.

    Thread Starter skiorski

    (@skiorski)

    Never mind, I found it.

    EhsanAhmad

    (@ehsanahmad)

    care to share ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘If… Else statement’ is closed to new replies.