Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to remove Login sidebar from BP 1.2 Default Theme

Viewing 15 replies - 1 through 15 (of 15 total)
  • Yup… it’s not a widget. Two options which would involved making a child theme. Don’t worry… it’s really simple: https://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/

    1. Make a child theme with a custom sidebar.php file and comment out or delete the login block of code.
    2. Make a child theme and add this line to your “style.css” file

    #login-text, sidebar-login-form {display: none;}

    I suppose you could also try adding the code below to a “custom.php” file and putting it in your plugins directory (no child theme required)… but now I’m just getting silly. LOL (I haven’t tested this BTW).

    <?php

    add_action('wp_head', 'hide_login');
    function hide_login() {
    echo <<<CSS

    <style type='text/css'>
    #login-text, sidebar-login-form {display: none;}
    </style>

    CSS;
    }

    ?>

    or even this! (very silly)

    <?php

    add_action('bp_before_sidebar_login_form', 'open_login_comment');
    function open_login_comment() { echo '<!--' }

    add_action('bp_after_sidebar_login_form', 'close_login_comment');
    function close_login_comment() { echo '-->' }

    ?>

    So how to you intend for people to login? Just via the regular WordPress login?


    dwdutch
    Participant

    @dwdutch

    Thanks, David. I’ll pursue these options then let you know what happens.

    As for login, Id like to use the “Login with Ajax” widget because it has a “Forgot password” option and it allows for redirects to custom URL on login and/or logout. I’d like to stay away from the WP screen, if possible.

    In fact, that’s yet another challenge: how to give them access to create Posts without seeing the WP-admin screens — especially since I want any profile changes to be done via BP (so they’ll see their xprofile fields) rather than the more simplistic WP fields. alas… for now, i need to get some of them started and I’ll have to save that battle for another day.

    This blog is for a private group of about 20 people.

    There is a plugin called “Postcard” which offers simple front end blogging.


    dwdutch
    Participant

    @dwdutch

    Well, I tried all 4 options but have had no luck. At the heart of #1 & #2 was the fact that building a child theme (at least, for me) did not work. The description on the link seems straight forward enough but as i put files in-place (even without any additional customization attempt) the BP default theme did not fully recreate itself – i.e. neither the adminbar nor the sidebar re-appeared after i activated my skeleton theme. Approach #3 & #4 are very clever but they didn’t work wither. on #4, i think it didn’t like the echo statement not being terminated with a “;” and even after trying that it still threw an error.

    The positive out of this is that you’ve convinced me that creating a child theme really isn’t that hard. unfortunately, I just don’t have thte time nw to figure out why it didn’t work — although i triple-checked file placement, content, etc.

    Presumably, others are creating child themes so i must be over-looking something very simple. I’ll come back to this another day. (Of course, if you – or anyone – have any other suggestions, let me know and I’ll try those when i resume).

    Your @import paths were probably just wrong.

    /*
    Template: bp-default
    Tags: buddypress
    */

    /* Parent styles */
    @import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css );
    @import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/default.css );

    Paste this into a ‘styles.css’ file in ‘themes/child-theme/’. It works. I tested it. I had not tested any of the solutions above. Just wrote them off the top of my head. I had missed the hash mark for starters on the sidebar-login-form declaration. The ‘echo’ statement was correct though. <<<Blah … Blah; is a valid php syntax. Altho’ I’ve never used it.

    /*
    Theme Name: Child Theme
    Template: bp-default
    Tags: buddypress
    */

    /* Parent styles */
    @import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css );
    @import url( ../../plugins/buddypress/bp-themes/bp-default/_inc/css/default.css );

    /* Custom styles */
    #sidebar-login-form,
    #login-text{display: none;}


    Anton
    Participant

    @antonrsaopencirclecoza

    @David – have you got a link to the “Postcard” plugin?

    It’s not in the plugin area on this site (thought it would be)… but DJ Paul mentioned it in this thread… near the bottom of the first page. Not sure if it works with 1.2 or if it even works at all yet! Sorry if I may have steered your wrong. Seems to be my theme for this thread. LOL :o)

    https://buddypress.org/forums/topic/is-buddypress-confusing-to-users#post-32033

    http://djpaul.dangerous-minds.net/postcard.zip


    Anton
    Participant

    @antonrsaopencirclecoza

    np David. I got all excited when I read about your “Postcard” plugin and when I went and looked for it, the only one available was a gallery postcard plugin. Don’t think that one will work lol.

    Checkout DJ Pauls’ plugin linked to above. It might work. Although it looks like it’s not been updated since Dec. 22.


    dwdutch
    Participant

    @dwdutch

    @David

    Thanks for the follow-up. I tried and it worked fine. Now, what’s odd is that (with the exception of the Custom Styles section) the lines in my file were the same. Okay, so my only explanation is that I must have had something else wrong on my site – after all, it was in the wee hours of the night that i was experimenting.

    Soooo, thank you for your input.

    Now, as I played with it more, I was able to successfully create my own unique child theme. I commented out the code for the sidebar login block (AND the comparable logout display) in sidebar.php but, here’s my question: why do your lines work?

    #sidebar-login-form,

    #login-text{display: none;}

    I went poking around in the buddypress forum and developers area but i didn’t find a comparable reference. How did you know about this “shortcut” (so i can find other such items if i need them)?


    r-a-y
    Keymaster

    @r-a-y

    @dwdutch

    Use a web developer toolbar.

    If you’re using Firefox, get Firebug.

    This plugin will remove the login form:

    <?php
    /* Plugin Name: remove buddypress login form
    * Description: remove buddypress login form
    * Author: PerS
    * Version: 1.0
    * Author URI: http://soderlind.no/
    * Plugin URI: http://soderlind.no/
    */

    add_action('bp_before_sidebar_login_form', 'ps_before_sidebar_login_form');
    function ps_before_sidebar_login_form() { ob_start(); }

    add_action('bp_after_sidebar_login_form', 'ps_after_sidebar_login_form');
    function ps_after_sidebar_login_form() { ob_end_clean(); }
    ?>

    <?php
    /* Plugin Name: remove buddypress login form
    * Description: remove buddypress login form
    * Author: PerS
    * Version: 1.0
    * Author URI: http://soderlind.no/
    * Plugin URI: http://soderlind.no/
    */

    add_action(‘bp_before_sidebar_login_form’, ‘ps_before_sidebar_login_form’);
    function ps_before_sidebar_login_form() { ob_start(); }

    add_action(‘bp_after_sidebar_login_form’, ‘ps_after_sidebar_login_form’);
    function ps_after_sidebar_login_form() { ob_end_clean(); }
    ?>

    I’m unable to find a plugin by this name, anything new here, that login on the right sidebar takes up way too much real estate and the nav bar has login in it already.


    @mercime
    Participant

    @mercime

    @lazyym create a file remove-login.php and then open in text editor and paste in code PerS, save the file and upload to wp-content/plugins/ folder.
    OR

    open your active theme’s functions.php file and add the code from the “add action” part to just before the ? and the ‘>’

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How to remove Login sidebar from BP 1.2 Default Theme’ is closed to new replies.
Skip to toolbar