Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to get a page to display the /members slug?

  • @sootsnoot

    Participant

    WP 6.6.2, BP 14.2.1, Divi theme.

    I added a bunch of WordPress users to my site from a csv file using the Import and export users and customers plugin. Worked well. But those users couldn’t figure out how to make friend requests, since they couldn’t “see” the other users that they could ask. After some fumbling through this forum and googling, I came across the “/members” slug. I seemed like exactly what I needed, a list of members with a button to send a friend request to each one. The only problem was that it didn’t show all the users. More ressearch found this post from 10 years ago. Seems the issue was/is that it only shows those users who have had some BuddyPress activity recorded. But since these were mostly new users, most had no activity. So I wrote a little bp-custom.php file containing:

    function make_all_users_active() {
        $users = get_users();
        // repete_log(print_r($users, true), __FILE__, __LINE__);
        foreach($users as $user) {
            if (strlen(bp_get_user_last_activity($user->ID)) == 0) {
                // repete_log(sprintf("bp_update_user_last_activity(%s)", $user->ID), __FILE__, __LINE__);
                echo $user->ID . "<br>";
                bp_update_user_last_activity($user->ID);
            }
        }
    }
    add_action ('wp_loaded', 'make_all_users_active');
    

    This solved the problem of not showing all the other BuddyPress members, but as far as I can tell, I’ve now got to tell all the users that if they’re interested in making friend connections, they have to go to the address bar, and type /members right after the domain name. That seems ridiculous! I guess I could add a page containing a link to that slug that they could click, but it would be nicer if I could make a page they could find as one of the site’s pages that would display the information from that slug, without having to click a link. Better still would be to be able to customize the BuddyPress drop-down menu to add an item for “All Members” that would display the slug’s contents…

Viewing 8 replies - 1 through 8 (of 8 total)
  • @thinlizzie

    Participant

    Create a yourdomaindotcom/members page and add a link to that page on the main site menu …

    @thinlizzie

    Participant

    That page should exist already, anyway.

    @sootsnoot

    Participant

    Well, yes, it exists in the sense that you can enter the url, and see the desired content. The questioon is how to make the page prominent. If I create a page, then I can put a link on it to go to the /members url. But I wanted to create a page (listed among the pages on my site) that would display that content. I actually tried using the Insert Page plugin, but I couldn’t get it to work for me. Guess I could dig into iframes a bit. It just seems strange that after all these years, BuddyPress doesn’t make it very easy for users to find the other members of a site to whom they could make friends or invite to join a group…

    @thinlizzie

    Participant

    Put your link in the main site menu.
    Call the link “All Members” or whatever.
    Point that link at the /members page.

    @thinlizzie

    Participant

    Is that not prominent enough?

    @sootsnoot

    Participant

    Yes. I guess my silly little problem is that I don’t know how to edit the main site menu. I’m using the Divi theme, which by default adds the pages I create to the menu. I need to find the setting to manually add items to that menu. Though, IMHO, such an item really belongs in the BuddyPress admin bar dropdown, under the Friends item…

    Thanks for clarifying the actual problem!

    @thinlizzie

    Participant

    You can add items to the main site menu …

    WP Admin -> Appearance -> Menus

    @sootsnoot

    Participant

    Ah, thanks! It took a bit of fiddling to find the way to add a new item with custom text and link, but when I did, it worked exactly as I wanted!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar