WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the wordpress menu I would like to add a link to the buddypress user profile and messages. These links are dynamic based on the username like, http://buddypress.org/community/members/username/messages/, for example.

I know you can get the username with php but that is not allowed within wordpress menus (wp-admin/nav-menus.php) from what I can tell. I also need to add them at a specific place in the menu, not just at the end. What would be the simplest way to add these dynamic links to the wordpress menu?

Main Menu -> Human Resources -> Employee Resources -> Messages
Messages needs to link to the buddypress user's messages

share|improve this question

closed as off-topic by Pieter Goosen, ialocin, kaiser Aug 7 '14 at 11:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

The desire is to have "My Profile" "My Messages" as Wordpress Menu items. I'm not sure it can be done, because I've never seen a dynamic menu item before, and Salutation people kind of thought of everything...

HOWEVER, it just occurred to me that you could put a static link to a static page in the menu, but have those pages Dynamically Redirect based on bp_get_user_id() or whatever it is:


Sorry this isn't a full answer but I'm just being creative here.

So, make a menu item "My Profile" link = "example.com/redirects/my-profile" which then uses onwe of her methods to redirect them to example.com/members/%USERID% or something like that.

share|improve this answer

This will give you the user-specific profile URL:

<? echo bp_loggedin_user_domain(); ?>

If you'd the link to go to the user's Messages page, just add to the end like so:

<? echo bp_loggedin_user_domain().'messages/'; ?>
share|improve this answer

I believe this question is the same as what you are asking; see if the answer to that question helps you.

If that doesn't help, you may want to see if the BuddyPress Links WordPress plug-in provides the additional functionality that you require.

If neither of those solutions prove helpful enough, please provide a link to your site and point out which menu you are trying to add BuddyPress links to and we can give you more specific information.

share|improve this answer
Thank you for the reply however the question you linked is for adding links to the buddypress menu where as I want to add buddypress links to the wordpress menu. Also BuddyPress Links seems to be more off a Digg style plugin where users can share links. Unfortunately I can not provide a link to my site as it is an intranet and is locked down. – Jackie Keiser Nov 30 '11 at 17:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.