Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Login link in admin bar

  • Avatar of fpats
    fpats
    Participant

    @fpats

    Hi,
    Is it possible to change where my “Login” link goes to on the admin bar?

    Currently it routes to the default WP login page. I have a custom page located elsewhere in my installation and need to point to the new custom page. Can someone simply tell me where the current file is that contains the “Login” link and how to modify it to a new URL?

    Many thanks :)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of jetkappu
    jetkappu
    Participant

    @jetkappu

    yeah i was looking for this too :)

    up up

    Avatar of lenasterg
    lenasterg
    Participant

    @lenasterg

    You can try the following.
    Into your /plugins folder create a file bp-custom.php.
    Into the file put the following code:

    
    function custom_bp_adminbar_login_menu() {
        global $bp;
        global $wp;
        remove_action('bp_adminbar_menus', 'bp_adminbar_login_menu', 2);
        if (is_user_logged_in())
            return false;
        echo '<li class="bp-login no-arrow"><a href="NEW_LOGIN_URL">' . __('Log In', 'buddypress') . '</a></li>';
        // Show "Sign Up" link if user registrations are allowed
        if (bp_get_signup_allowed()) {
            echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __('Sign Up', 'buddypress') . '</a></li>';
        }
    }
    
    add_action('bp_adminbar_menus', 'custom_bp_adminbar_login_menu', 1);
    

    Bests,
    Lena

    Avatar of jetkappu
    jetkappu
    Participant

    @jetkappu

    so many error when i try it..

     function custom_bp_adminbar_login_menu() { global $bp; global $wp; remove_action('bp_adminbar_menus', 'bp_adminbar_login_menu', 2); if (is_user_logged_in()) return false; echo '•' . __('Log In', 'buddypress') . '
    '; // Show "Sign Up" link if user registrations are allowed if (bp_get_signup_allowed()) { echo '•' . __('Sign Up', 'buddypress') . '
    '; } } add_action('bp_adminbar_menus', 'custom_bp_adminbar_login_menu', 1);
    Warning: Cannot modify header information - headers already sent by (output started at /home/...../public_html/wp/wp-content/plugins/bp-custom.php:14) in /home/....../public_html/wp/wp-login.php on line 368
    Avatar of lenasterg
    lenasterg
    Participant

    @lenasterg

    Which version of Buddypress you have?
    Do you use WP Toolbar or the BuddyBar?
    The above works (at least for me) with BuddyBar.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.