Skip to:
Content
Pages
Categories
Search
Top
Bottom

menu link member list


  • reivilob
    Participant

    @reivilob

    Hi

    I want to add to one menu a link to the member list page ( /members/ ) but this only for login users …

    Any idea ?

    OB

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

  • danbp
    Participant

    @danbp

    No details = no ideas… Which menu ? A default WP menu ? A BP menu ? A custom menu ?

    Usually, you can use a conditionnal like this

    if (is_user_logged_in() ) {
       // do something
    }

    reivilob
    Participant

    @reivilob

    Hi
    it does not change the problem. (both WP menu or BP menu is interesting)
    In my case at a WP menu
    In the WP menu admin you have a Buddypress section where you can select a lot of BP feature for login or logout users, but the Member list is not available here…

    If there is a way to do it by functions.php it is ok for me but not clear how to do it and by example define the position in the menu …

    Best regards
    Olivier


    danbp
    Participant

    @danbp

    See this tutorial if it helps.


    reivilob
    Participant

    @reivilob

    Hi
    I know that but like this you will not be able to define properly the position in the menu…

    I try to add the “Buddypress members list page” to the list of the pages available in the “buddypress” section of the WP admin Appearance menu management page.
    (where you have by default the checkbox for: Activity, Profile, Notifications, Messages, Friends,…)

    I really not understand why this page is not here by default …

    OB


    danbp
    Participant

    @danbp

    Because pages are not user related items ?

    Members Directory page is in the Pages section of the menu customizer. If you want link to it you take it from there.
    The BuddyPress section contains dynamic items for logged-in or logged-out user.


    reivilob
    Participant

    @reivilob

    I absolutely agree with you but it make sense to allow access to the member list only for login users and to be able to easily place it in a menu, at the position you want and this is not possible now …

    If you select it from the page list, you can not specify if user must be login to have it in a menu (genera menu or personal)

    It is not available in the buddypress login section. Here are only user related informations, but no resources reserved for buddypress login users, like private pages or others private features …

    I think the only way to process is to create (php) a menu menu for the login user, and create a menu that concatenate the basic menu with this one and display the result…

    OB


    danbp
    Participant

    @danbp

    – you can add a condition for logged-in user on the directory template.
    – for the menu itself, and specially if it is a wordpress menu like primary, you need to write a function. Here another tutorial for this. It’s similar to the other i’ve mentionned previously, but with more examples (including positionning and conditionnals).

    wp_nav_menu()

    wp_get_nav_menus()

    And you can also open an enhancement ticket if you estimate this should be part of BuddyPress and not only WordPress.

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