Edit the bbPress login widget
-
Hi guys,
the way bbPress outputs the login page bugs me, a lot. What I am trying to do is add a login box to my layout, when I did – I found it added a list and a horrible fieldset around the whole thing. This doesn’t work with my design at all.
So, on with my quest to change this, I found there is no template readily available to just change. Really? So, it seems all I can do is hack away at the core code, which will all be reverted once a new version comes around.
Does anyone have any suggestions for this?
-
It bugs me as well.
Two solutions I have documented
You can also copy the core file into your functions file, hack it and rename it. There are several places it needs renaming, and if you would like to post your working solution, I’ll happily make a functions file version, as long as I can use it publicly
I wanted to do that too.. but unfortunately I couldn’t find a better answer so I had to edit the widgets file under includes/common/widgets.php ( my forum ) .
the way bbPress outputs the login page bugs me, a lot. What I am trying to do is add a login box to my layout, when I did – I found it added a list and a horrible fieldset around the whole thing. This doesn’t work with my design at all.
are you using the shortcode [bbp-login] ??
you should use that shortcode if not.
more shortcodes supplied with bbPress that you can use.
https://codex.bbpress.org/shortcodes/
I found there is no template readily available to just change. Really?
yes there is its called
form-user-login.phpSo, it seems all I can do is hack away at the core code, which will all be reverted once a new version comes around.
dont do that
If you want to alter the widget, then you can rename it and put it as an additional widget in your functions file.
You will need to rename it in several places.
If you want to work on the core version and get it working, then if you want to post a revised core version (and any associated css) here, then I’ll quite happily work out the rename areas so you can then post it in your functions file – as long as your version is freely available for others (and me) to use.
how do you want it to look?
Like this:
post a link to your site
a little CSS could fix up the input box awkwardness and also help put labels on top.
I fixed the look of it on desktop but it looks off on mobile. Needs spacing.
you can see it comes back to normal on very small sizes close to 200 maybe settings a max width for the login form would do the job.
try something close to this , edit if you want.
.widget.bbp_widget_login .bbp-login-form { max-width: 270px; }Where do I place the code?
I added it to the style.css file. But on here it still looks the same:
carfanaticsforum.com/login
For mobile.
do this instead since you want it for all of the bbPress login forms.
.bbp-login-form { max-width: 270px; }and you could put the CSS in many places
a custom css plugin
jetpacks css module
your child themes stylesheet
the bbpress.css stylesheet that should be copied to your child theme in a bbpress folderThank you. Worked like a charm.
I have another question. I’m trying to add the log in and log out code into functions but I get the following error:
Parse error: syntax error, unexpected ‘Logout’ (T_STRING) in /home/carfan6/public_html/wp-content/themes/sparkle-child/functions.php on line 33
can you post lines 30-34 please
All the code can be viewed there.
try changing ‘logout’ to “logout”
I did but it ended up looking like this:
Another thing you might try is one of the many login widgets in the WordPress plugin repository. It doesn’t have to be specific to bbPress to work. For example, here’s a tabbed login widget that looks pretty nice.
Try the following
//adds login/logout to menu //filter to add login/logout to menu add_filter( 'wp_nav_menu_items', 'my_nav_menu_login_link' ); function my_nav_menu_login_link($menu) { //uncomment the next line if you only want login on bbpress pages //if(is_bbpress()) { if (is_user_logged_in()) { //set the $url on the next line to the page you want users to go back to when they logout $url = 'http://www.mysite.com/forums' ; $url2=wp_logout_url($url) ; $loginlink = '<li><a title="Logout" href="'.$url2.'">Logout</a></li>'; } else { $current_user = wp_get_current_user(); $user=$current_user->user_login ; //set $page on the next line = the permalink for your login page $page='login' ; $loginlink = '<li><a href="/'.$page.'/">Login</a></li>'; } //uncomment out the next lines if you only want login on bbpress pages // } // else { // $loginlink="" ; // } $menu = $menu . $loginlink; return $menu; }Is that for me?
can you help me fix the look of the registration page? – buttons.
only if you can tell me what you would like changed !
- You must be logged in to reply to this topic.


