Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing profile link from wp-admin to bbpress profile


  • chitaranjan.thoudam
    Participant

    @chitaranjanthoudam

    I have the below code in my menu to add login & register. it is working fine but I just want to redirect the profile link to bbpress profile page instead of going to wp-login. Currently user role displays in the place of register after logged in, it will be great if some one help me to get “Welcome username” and link to bbpress profile page.

    Thanks so much in advance…

    add_filter(‘wp_nav_menu_items’, ‘add_login_logout_link’, 10, 2);
    function add_login_logout_link($items, $args) {
    if( $args->theme_location == ‘top-menu’ ) {
    $loginoutlink = wp_loginout(‘index.php’, false);
    $registerlink = wp_register(”, ”, false);
    $items .= ‘<li class=”menu-item login”>’. $loginoutlink .” . ‘<li class=”menu-item register”>’ . $registerlink . ”;
    }
    return $items;
    }

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

  • nobouffa
    Participant

    @nobouffa

    I am having the same issue on our site and can’t find where to edit the
    profile” link. we are suing the login with ajax plugin as well.


    Robin W
    Moderator

    @robin-w


    nobouffa
    Participant

    @nobouffa

    Robin, yes this is to add a Profile link in the Menu, but we are trying to edit the Profile link in the sidebar widget.

    Currently a non admin user clicks on the Profile link in the widget and they get directed to the Admin profile page, /wp-admin/profile.php .

    And we need to edit that link to go to the bb user profile page,
    /forums/users/%user%/edit

    Does anyone know what file that property is being set at?


    Robin W
    Moderator

    @robin-w

    hmm..
    with bbPress you should have a login widget that takes them to the bbPress profile,

    I add the following code to it to make editing obvious

    <p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>
    

    You should be able to use that in your widget, or use it to substitute


    Robin W
    Moderator

    @robin-w

    edited to get the link right !

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

You must be logged in to reply to this topic.