The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Add the Social Logi...
 
Share:
Notifications
Clear all

[Solved] Add the Social Login Buttons to wp-login.php

5 Posts
2 Users
0 Reactions
1,866 Views
Posts: 22
Topic starter
(@gooloode)
Eminent Member
Joined: 2 years ago

Hi,

i've finally been able to use ChatGPT and asked it something i want soooo badly. The Social Login Buttons appearing on the wp-login.php Page. So i've had this Conversation:

Do you know how to add the Social Login-Buttons from the WordPress Plugin "wpDiscuz" to the Login-Page on a WordPress Website?
Yes, I can help with that. The process for adding social login buttons from the "wpDiscuz" plugin to the login page on your WordPress website will vary depending on the theme you are using, but here's a general guide:

Install and activate the wpDiscuz plugin on your WordPress website.
Go to the wpDiscuz settings page and navigate to the "Social Login" tab.
Configure the social networks you want to enable for social login. You can enable networks like Facebook, Google, Twitter, etc.
Once you have configured the social networks, you will need to add the social login buttons to the login page. You can do this by editing the login page template of your theme.
You need to find the template file for the login page in your theme, it is usually called login.php or page-login.php
Once you have found the login page template, you will need to add the code for the social login buttons. You can use the following code to add the social login buttons:
Copy code
<div class="wpd-social-login-buttons">
<?php do_action('wpdiscuz_social_login_buttons'); ?>
</div>
Once you've added the code, save the changes to the template file and upload it to your server.
You should now see the social login buttons on your login page. Keep in mind that the process might be different depending on the theme you are using, so you might need to tweak the code a bit or contact the theme's support if you have any issues.

Nico Pahl
Where should i put the code in wp-login.php?
You can place the code I provided in the "wp-login.php" file, specifically in the area where you want the social login buttons to appear.

You can look for the following code in the wp-login.php file:

Copy code
<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
You can place the code I provided after this line and before the closing form tag.

Keep in mind that editing the core WordPress files is not recommended, as it can cause issues if an update is released. A better way to make the changes is to create a child theme and copy the login.php file to the child theme and make the changes there. This way, your changes won't be overwritten when updating your theme or WordPress.

Also, if you don't have access to the login.php file, you can use a plugin such as "Code Snippets" to add the code to the appropriate hook, so it will not affect your core files.

Nico Pahl
I added the code, but the Buttons don't appear.
There are a few things you can check if the social login buttons are not appearing on the login page:

Make sure that the plugin "wpDiscuz" is installed and activated.
Check if the Social Login feature is enabled in the plugin settings.
Check if the plugin has been configured with the appropriate API keys for the social networks you want to use for login (e.g. Facebook, Google, etc.)
Check the page source code to see if the social login buttons are being loaded on the page. If they are not, check the browser's developer console for any error messages or issues that might be preventing the buttons from being displayed.
Make sure that you have added the correct code and that it is placed in the right place in the login.php file.
Try to clear your browser's cache and cookies and check again.
Make sure you are using the correct login page, the social login button should only appear on the login page not on the registration page or the forgot password page.
Check the compatibility of the plugin with your current theme and WordPress version.
You might also try to reach out to the plugin's support team for more help and troubleshooting.

 

So i did what ChatGPT told me, but the Buttons don't appear. Yet the Div wpd-social-login-buttons appears in the Source Code? Did "we" do something wrong or is there another way to add the Buttons in to the Login Template?

4 Replies
Asti
Posts: 7617
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

@gooloode,

We're really sorry but the wpDiscuz social login feature is designed for displaying above the comment form, but nowhere else.

2 Replies
(@gooloode)
Joined: 2 years ago

Eminent Member
Posts: 22

@asti Can i use another Plugin then to enable Social Logins that uses maybe wpDiscuz' Gateway URLs or that doesn't interfere with wpDiscuz? If so, what Plugin? Please also See the Post below.

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7617

@gooloode,

Sure. You can use other social login plugins. If the plugin uses the native (core) WordPress functions and hooks, then you should not get any issues. 

Posts: 22
Topic starter
(@gooloode)
Eminent Member
Joined: 2 years ago

I think thats a big flaw though that should maybe be considered. Especially for Users in the EU. All the Privacy Tools are embedded (on my site) mostly in the Backend, f.ex. via the Edit Profile Section where a lot of functions reside. But no one thinks "I should login above a comment form, then switch to the login-page to then be redirected to the profile section". There should be a compromise to enable a login option to the designated login-page. Because i really like wpDiscuz, but currently thats just a design flaw for everyone, especially website owners in the EU with "backend"-functions to the generel public.

Share: