Replace default buddypress login with “Login with Ajax”
-
Hello,
how can i replace the default login of buddypress with the plugin login with ajax?
-
no one a idea?
thank you
If you’re using the bp-default theme, the login sidebar is created at buddypress/bp-themes/sidebar.php. You could copy that file to your child theme directory and modify lines 29-56 to contain whatever login markup you’d like.
Man, this makes very little sense to me.
I want to insulate all of my members from any WordPress panels. So far, THE only place I see the problem occurring is when a user types in a bad profile/password. In that case he/she is taken to the “wiggling” login page. I looked at a couple ajax login plugins, but they don’t really “replace” the default login.
Shouldn’t BP have an option to turn off the default login? Or maybe have it set up so that the default login widget is a pre-installed widget that could be removed/replaced?
Login_with_Ajax doesn’t automatically replace buddypress sidebar login form.
You can either modify or remove the sidebar login form.
If modify– follow Boon’s instruction, modify lines 29-56, take the widget_out.php as reference, and no need to add LWA widget
if remove–put this in your child theme’s functions.php, then, add LWA widget in sidebar:
`add_action(‘bp_before_sidebar_login_form’, ‘mesh_before_sidebar_login_form’);
function mesh_before_sidebar_login_form() { ob_start(); }
add_action(‘bp_after_sidebar_login_form’, ‘mesh_after_sidebar_login_form’);
function mesh_after_sidebar_login_form() { ob_end_clean(); }`My original thought was to just comment out 29-56, and then add the widget to the sidebar.
But, I guess that’s not really the point. Buddypress seems to be designed around the concept of being “hack free”. And then, what does BP do? Put something in the “core” template that requires a work-around. In the “old days” I had to hack themes and plugins right and left to make them work. I was kinda hoping I could work with Buddypress in the same framework I’ve been used to with WP in general. Guess not?
Sure you can comment out 29-56.
The code I posted is for the case that if you don’t want to touch the theme template,OK. So, is there a way to generically modify functions.php (like another WordPress hook or whatever) so that if I change themes the code you gave me would not “go away”. Or, would I have to make the same changes in a new theme if I decided to use it?
`bp_before_sidebar_login_form`
and
`bp_after_sidebar_login_form`
As long as be default theme has these 2 line before and after sidebar login form, the code should work.
This means if BP decide to change these 2 hooks to something else, you can change my code to
`add_action(‘before_somethingelse’, ‘mesh_before_somethingelse’);
function mesh_before_somethingelse() { ob_start(); }
add_action(‘after_somethingelse’, ‘mesh_after_somethingelse’);
function mesh_after_somethingelse() { ob_end_clean(); }`
- The topic ‘Replace default buddypress login with “Login with Ajax”’ is closed to new replies.