Support » Plugin: WordPress Social Login » How to show social login above wp form

  • Resolved Manish

    (@nims)


    I wish to show the social login icons before the register/login form.
    How can that be done ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @nims,

    The only hooks before the login form are outside the container and are related with login state messages. However, if you don’t have a problem with that, you can still add the buttons there.

    First, you need to select the option “Do not display the widget anywhere, I’ll use shortcodes” in Settings > WP Social Login > Widget > Advanced Settings > Widget Display. Then, add this code snippet in your functions.php file of your current theme or in a custom plugin:

    function wp_social_login_buttons() {
      echo do_shortcode('[wordpress_social_login]');
    }
    add_action('login_message', 'wp_social_login_buttons', 1);

    Now you’ll see a screen like this:

    Best regards,
    Yordan.

    Thread Starter Manish

    (@nims)

    Thank Yordan.
    But it does not work on my theme. I am using classipress from appthemes.

    See this after adding the code in functions.php and enabling do not show …
    https://prnt.sc/vr1u85

    Do I need to add any code in the template file as well ?

    • This reply was modified 5 months, 1 week ago by Manish.

    Sorry, the code I wrote above only apply for your dashboard login. If you want to show the icons in a form in frontend, and if you can edit the form area, you can use the following shortcode in the place you desire: [wordpress_social_login].

    If you can’t edit this area, try to find an action hooks in that area and try to replicate the code above, changing the login_message hook for the one you find.

    Best regards,
    Yordan.

    Thread Starter Manish

    (@nims)

    Thanks I used
    <?php echo do_shortcode('[wordpress_social_login]'); ?>
    in the template file. It is working fine now.

    Do I need the code in functions.php file also or I can remove that ?

    I’m glad to hear that you solved it.

    You don’t need the code in functions.php, just delete it.

    Please, remember to change the status of the topic as resolved 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.