• Resolved adekenney

    (@adekenney)


    Hi all! I’m using the “Insert PHP” plugin on my site. I am trying to display an image based on whether a user is logged on or not. A simple “echo” works but if I add a line to display a JPEG then nothng is displayed at all (not even the echo). This is my code :
    [insert_php]
    if ( is_user_logged_in() ) {
    echo ‘YOU ARE LOGGED IN!’;
    } else {
    echo ‘NEED TO LOG IN!!!!’;
    <p style=”text-align: center;”><img src=”http://www.nal.pm/wp-content/images/LOGIN.jpg&#8221; alt=”” /></p>
    }
    [/insert_php]
    If I remove the line that displays LOGIN.JPG then it works, ie, the ECHO is displayed, but if I leave it in then NOTHING is displayed, ie, neither the JPEG or the ECHO.
    Any ideas?!

    Thanks, Ade.

Viewing 1 replies (of 1 total)
  • Thread Starter adekenney

    (@adekenney)

    Now resolved by :

    [insert_php]
    if ( is_user_logged_in() ) {
       echo 'YOU ARE LOGGED IN!';
    } else {
       echo '<p style="text-align: center;"><img src="http://www.nal.pm/wp-content/images/LOGIN.jpg" alt="" /></p>';
       echo '<p style="text-align: center;"><img src="http://www.nal.pm/wp-content/images/REGISTER.jpg" alt="" /></p>';
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 1 replies (of 1 total)
  • The topic ‘is_user_logged_in() Not Working’ is closed to new replies.