Skip to:
Content
Pages
Categories
Search
Top
Bottom

Linking to a Non-root Profile URL

  • Avatar of pantone
    pantone
    Participant

    @pantone

    I currently have root profiles disabled with the following code:

    `define ( ‘BP_ENABLE_ROOT_PROFILES’, false );`

    However on my navigation links, in header.php, I have the following code that still links to the root profile for logged in users:

    `<a href="”>Profile`

    Basically, I am trying to figure out how I can link to the profile without the username in the root which is: “domain.com/members/username”.

    I tried: `<a href="members”>Profile`, but it links to: “domain.com/username/members”.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of pantone
    pantone
    Participant

    @pantone

    Update: so I’ve also added the code in functions.php:
    `define ( ‘BP_MEMBERS_SLUG’, ‘members’ );`

    I then updated this on header.php:
    `<a href="”>Profile`

    but all it returns is:
    “domain.com/username/members”.

    How do I change the function so it goes to: “domain.com/members/username”.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    If you don’t need root profiles, you shouldn’t need the define line. Try removing it to see what happens.

    Avatar of pantone
    pantone
    Participant

    @pantone

    @r-a-y, thank you for your help! By removing that define line from functions, account settings profile pages are now linked to: “domain.com/members/username”.

    Thank you, really appreciate your help.

    Another inquiry while we’re on the subject — I currently have Extended Profiles disabled, but I have Account Settings enabled. I’ve been testing different WordPress roles on my site and discovered that if a subscriber types in their browser: “domain.com/members/anothersubscriber” (where “anothersubscriber” = another member on the site that is also a subscriber), they receive an error (404) page. Obviously this happens because non-admins are not allowed to have this type of access. However, instead of throwing a 404 page, how can I have their (note: “their” meaning non-admins. in my case, subscribers) request redirect to the homepage or to their own profile page?

    Thank you!

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

You must be logged in to reply to this topic.