WordPress.org

Ready to get started?Download WordPress

Forums

Simple Twitter Connect
how to call the twitter connect button outside of the login form (8 posts)

  1. cybersnac
    Member
    Posted 3 years ago #

    can you please tell me how I can place the Sign in with Twitter button on a page other than the login page?

    e.g. use a function call such as this example that doesn't work ;)

    <?php if(function_exists('stc_login_add_login_button')){stc_login_add_login_button();}?>

  2. Eric Andrew Lewis
    Member
    Posted 3 years ago #

    Bump.

    This is an issue. I tried using the same function to create a button.

    However, I did it a little differently.

    <?php
    global $action;
    $action = 'login';
    stc_login_add_login_button();
    ?>

    To even create the button you need to define the global $action as 'login'. I embedded the button on my hompage this way. However, when I click it there is no log-in, it just reloads my homepage.

    I'm trying to go through the code but not having much luck in finding out the issue.

  3. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    The issue is that it's not designed to do that, nor was it ever designed to do that. STC is not capable of producing login buttons in other places than the Login screen.

  4. Eric Andrew Lewis
    Member
    Posted 3 years ago #

    figured out a line of code that works, here it is:

    <?php
    echo '<p><a href="'.get_bloginfo('url').'/?stc_oauth_start=1&stcaction=login&loc='.get_bloginfo('url').'/wp-login.php%3Fredirect_to=http%253A%252F%252F'.str_replace( array('http://','/'),'',get_bloginfo('url') ).'&type=authenticate"><img border="0" src="'.get_bloginfo('url').'/wp-content/plugins/simple-twitter-connect/images/Sign-in-with-Twitter-darker.png" /></a></p>';
    ?>
  5. MG7282
    Member
    Posted 3 years ago #

    Any news on this?

  6. neononcon
    Member
    Posted 3 years ago #

    @ericlewis that works perfectly (especially with Ottos PHP Code Widget plugin). But the problem is that it will confuse your site users to think the Twitter login doesn't work. Because when you use that button, it takes the user to the wp-login screen and has a red error message"ERROR: Twitter user not recognized."

    This seems to be because the way it's coded is that the user first has to login the normal way, then go to their profile and connect their twitter account.

    It works well, but it's deceiving because it leads us to believe activating this feature in STC will give us an actual login button for our users, but in fact it does not do that as RPX, etc would do.

    Any input Otto?

  7. cybersnac
    Member
    Posted 3 years ago #

    thanks everyone. I'm going to hold off on implementing this with this plug-in until and unless the functionality is built into it properly for this specific feature.

  8. Eric Andrew Lewis
    Member
    Posted 3 years ago #

    @neononcon i found a different plug-in that works in a facebook connect button with more global usability. wp-fb-autoconnect can be implemented on nearly any page. out of the box it creates a widget, but with a bit of coding you can include the button anywhere.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic