Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • damienoneill2001
    Participant

    @damienoneill2001

    Hey guys,

    Just want to say that this helped me out with my project a lot.

    Setting up the different Members Directories as new templates was such a simple and obvious idea! It was exactly what I needed!

    Thanks!

    Damien


    damienoneill2001
    Participant

    @damienoneill2001

    Hey @latinosamorir

    Were you able to find a solution to this?

    Damien


    damienoneill2001
    Participant

    @damienoneill2001

    To resolve this, I used bp_get_loggedin_user_username() instead of bp_loggedin_user_username().

    Thanks to @shanebp for this


    damienoneill2001
    Participant

    @damienoneill2001

    @shanebp,

    Thats great!

    This worked a treat for me!

    Damien


    damienoneill2001
    Participant

    @damienoneill2001

    Hi @mercime,

    I hope you can help with this.

    I have slightly altered code that you put up a year ago but am having a slight problem with it.

     // Filter wp_nav_menu() to add profile link
        add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link',10,2 );
        function my_nav_menu_profile_link($menu, $args) {      
                if( is_user_logged_in() && $args->theme_location == 'header2' ){
            $profilelink = '<li>Welcome, <a href="' . bp_loggedin_user_domain( '/' ) . '">' . bp_loggedin_user_username() . '</a></li>';
            $menu = $menu . $profilelink;
        }
        return $menu;
        }

    Basically, I am hoping for the menu item to simply say Welcome, **Username**.

    At the moment, it is displaying the username, but is actually removing it from the a tags and from the actual menu itself, so the code reads something like:

    <nav id="other-navigation" class="top-navigation" role="navigation">
        username
            <div class="menu-secondary-header-menu-container">
                <ul id="menu-secondary-header-menu" class="header_menu_2">
                    <li id="menu-item-1865" class="menu-item-1865"> This is the first Link in the menu</li>
                    <li>Welcome, <a href="http://www.mysite.com/profile/username/"></a></li>
                </ul>
            </div>
    </nav>

    Hopefully you can shed some light onto this?

    Cheers

    Damien


    damienoneill2001
    Participant

    @damienoneill2001

    Anyone able to help with this?


    damienoneill2001
    Participant

    @damienoneill2001

    Hey eveyone

    Just to give you an update on this query – I spoke with the author of the plugin and they were able to tell me that the plugin is not designed to work for multiple directories, however, they did provide a quick workaround. Here are the steps provided which worked for me:

    “If you are not going to use BP Profile Search widgets or
    shortcodes, you could try this patch:

    1. in the bp-profile-search plugin directory, open bps-searchform.php
    2. locate the line (line 9):

    $action = bp_get_root_domain (). ‘/’. bp_get_members_root_slug (). ‘/’;

    3. delete or comment out that line.”

    This worked for me!!

    Thanks Andrea!

    Damien


    damienoneill2001
    Participant

    @damienoneill2001

    Hi Modemlooper!

    Thank you so much for the response, I have only seen it now!

    I actually just managed to get it working myself. I will dig up the piece of code I used and post it in here for others asap!

    Thanks again for your help with this!

    Damien


    damienoneill2001
    Participant

    @damienoneill2001

    Hey guys,

    Anyone have any ideas on this?

    Thanks

    Damien

Viewing 9 replies - 1 through 9 (of 9 total)
Skip to toolbar