WordPress.org

Ready to get started?Download WordPress

Forums

Static Text if is_user_logged_in (1 post)

  1. futurepocket
    Member
    Posted 3 years ago #

    Social Connect doesn't work on my site (except for on wp-login.php) so I removed it from displaying on the comments form and am trying to add a manual <?php if ( is_user_logged_in ) to display Social Connects buttons and redirect to the wp-login page instead. This is the code I am trying to add into comments.php:

    <?php
    if ( is_user_logged_in() ) {
        echo '';
    } else {
        echo '<div style="font-weight:bold;"><p>Login with:<br /><a href="http://www.ahhelp.me/wp-login.php"><img src="http://www.ahhelp.me/facebook_32.png" /><img src="http://www.ahhelp.me/twitter_32.png" /><img src="http://www.ahhelp.me/google_32.png" /><img src="http://www.ahhelp.me/yahoo_32.png" /></a></div';
    }
    ?>

    It doesn't work though for some reason. Firstly, it doesn't show the buttons and even when I log out, it keeps showing the user that is logged in (admin in this case) but won't post a comment because the required information is not entered (but doesn't show required fields). I am guessing it's because there is a problem with that code... any idea how I can format that code properly? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic