WordPress.org

Forums

Nextend Facebook Connect
[resolved] Connect button to disappear on success. How? (5 posts)

  1. z3ff
    Member
    Posted 2 years ago #

    Hi :) i created a 'connect' button in my WP with your plugin and added it to the header.php. Here's button's code i used:

    <div id="content-box">
    <a href="http://www.test.freedrip.com?loginFacebook=1&redirect=http://www.test.freedrip.com"><div class="new-fb-btn new-fb-1 new-fb-default-anim"><div class="new-fb-1-1"><div class="new-fb-1-1-1">Connect</div></div></div></a>

    It works. But how do i make it disappear\change, after user 'connects'?

    http://wordpress.org/extend/plugins/nextend-facebook-connect/

  2. nextendweb
    Member
    Plugin Author

    Posted 2 years ago #

    You should use PHP code to verify if user logged in our not: is_user_logged_in

    <?php if ( !is_user_logged_in() ) { ?>
    <a href="http://www.test.freedrip.com?loginFacebook=1&redirect=http://www.test.freedrip.com"><div class="new-fb-btn new-fb-1 new-fb-default-anim"><div class="new-fb-1-1"><div class="new-fb-1-1-1">Connect</div></div></div></a>
    <?php } ?>

    Or if you would like to check if the current user has a linked Facebook account:

    <?php if ( !is_user_logged_in() || !new_fb_is_user_connected() ) { ?>
    <a href="http://www.test.freedrip.com?loginFacebook=1&redirect=http://www.test.freedrip.com"><div class="new-fb-btn new-fb-1 new-fb-default-anim"><div class="new-fb-1-1"><div class="new-fb-1-1-1">Connect</div></div></div></a>
    <?php } ?>
  3. z3ff
    Member
    Posted 2 years ago #

    Thanks a lot, it works :)
    i mean 1st code u gave me. About the 2nd - what exactly do u mean? if a user presses 'connect'(echoed with 1st code), it'll automatically offer him to log in, then, if he doesn't have the related app in his FB, to allow it, etc...no?

  4. nextendweb
    Member
    Plugin Author

    Posted 2 years ago #

    The second code is for the users who are not logged in or the logged in user doesn't have linked account with Facebook to your site. This helps your old users to simply link their account with Facebook profile, which helps them to log in faster :)

  5. z3ff
    Member
    Posted 2 years ago #

    great, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Nextend Facebook Connect
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic