Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] – How to get two separate menus


  • rickgoz
    Participant

    @rickgoz

    Hi,

    I would like to know if it is possible to get two different menus in BP: one for the non members which shows only blog links and an other one for the members which shows groups, members, forums and blog links.

    Thanks in advance.

    RG

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

  • rickgoz
    Participant

    @rickgoz

    No one?


    JamieWade
    Member

    @jamiewade

    You can restrict which pages a non-registered member can see, if thats any help? For example I have restricted all the pages for non-members, apart from the registration page, terms and conditions and my blog posts?


    @mercime
    Keymaster

    @mercime

    @rickgoz Yes, it is possible to get two different menus in BP. The simplest way is to surround the links for members only with conditional


    // the links

    An example using main navigation links in header.php of bp-default theme http://pastebin.com/uGQHhm8r


    rickgoz
    Participant

    @rickgoz

    Thanks a lot!

    Is there anyway to do this without touching buddypress’s core?
    I am not really good at php, could you tell me where do I have to put this code? :)

    Thanks in advance


    Hugo Ashmore
    Keymaster

    @hnla

    You do this in a child theme, please see the BP codex for guidance on how to create a child theme (easy!)
    https://codex.buddypress.org/theme-development/building-a-buddypress-child-theme/

    Mercime has shown you how and where it’s not really php coding it’s a matter of copy pasting .


    rickgoz
    Participant

    @rickgoz

    Can I surround several links with your conditional code? Or do I have to do it one by one?

    Because I put them all between this conditional code and now I have this error:

    Parse error: syntax error, unexpected T_ENDIF in /homez.193/www/wp-content/themes/jooc/header.php on line 87

    And when I checked this line, it doesn’t seem to have any problem..

    Also, I put the same code as you gave me on your link and I had the same error.

    Any idea?

    Thanks a lot!


    Hugo Ashmore
    Keymaster

    @hnla

    You just have a mis-matched if / endif you’ll need to work through the code to find out where that occurred, it’s not necessarily that actual line that has the issue but just where it first runs into it being an issue.

    It’s hard to tell what you have done wrong without being able to see the code really.


    @mercime
    Keymaster

    @mercime

    Yes, you can surround several links and even HTML elements with the conditional is_user_logged_in.

    The code in pastebin.com is for the header.php for child theme of bp-default theme as hnla mentioned above.

    The last time I checked, Jooc theme has not been updated for current BP/WP versions.


    rickgoz
    Participant

    @rickgoz

    okay! I am gonna work on it!

    But it’s not that easy and can drive me crazy ! :)

    Anyway thanks and I will let you know


    Hugo Ashmore
    Keymaster

    @hnla

    It can help to add extra spacing i.e carriage returns between those elements to make it visually easier to read and follow the flow of your Ifs and endif’s


    rickgoz
    Participant

    @rickgoz

    Just did it with bp-default theme; and same result

    Parse error: syntax error, unexpected T_ENDIF in /homez.193//www//wp-content/plugins/buddypress/bp-themes/bp-default/header.php on line 93

    I will try to understand the it and will let you know!


    rickgoz
    Participant

    @rickgoz

    Well I just found out how to use your cool website (pastbin.com) :)

    So here is the code I have

    http://pastebin.com/8atu2LUK


    Hugo Ashmore
    Keymaster

    @hnla

    Try changing:

    to


    rickgoz
    Participant

    @rickgoz

    Hahaha nice one!

    Thanks a lot it’s working! So now, even there is a buddypress’ update it will work or did I change buddypress’ core?

    Many thanks


    Hugo Ashmore
    Keymaster

    @hnla

    ? did you change a bp-default file or do as pointed out earlier and make a child theme?

    If you didn’t do so move your edited file to the child theme and either replace the original from the archive file or not worry as it doesn’t need to be there and an update will place a fresh copy anyway


    @mercime
    Keymaster

    @mercime

    Thank you @hnla :-)


    Hugo Ashmore
    Keymaster

    @hnla

    those damned pesky shift keys ;) :)

Viewing 17 replies - 1 through 17 (of 17 total)
  • The topic ‘[Resolved] – How to get two separate menus’ is closed to new replies.
Skip to toolbar