Hi there,
IF you’re familiar with wp_nav_menu() (see wp codex) bp_nav_menu() behaves the same way, and that’s the easiest way, I”ve found, to customize it. I hope this helps
If you just want to get a link to the current user that is logged in’s profile, and you’re using permalinks, this will work:
<a href="/members/<?php echo wp_get_current_user()->user_login; ?>/profile/">
//your html here
</a>
I’m using permalinks…
What I’m trying to accomplish is: I have an image, this image will be on a standard wordpress page and I want a logged in user to click on the image and be taken to their profile page.
I put this in the wordpress page on the text tab…
<a href="/members/<?php echo wp_get_current_user()->user_login; ?>/profile/">
<img src="http://mydomain.com/images/myprofile.png>
</a>
Nothing renders. I saw where you can’t run php from a page… could this be my issue?
Great! the code I posted above should work then. I havent tested it but that will work if you’re using permalinks. becuase bp will do members/user_login/profile/ by default so you jsut need their user_login which you can ECHO out via the PHP using wordpress alone.
You’re putting that in the page itself? Yeah you have to use a php file.
You could use hanacode plugin https://wordpress.org/plugins/hana-code-insert/ to insert php
Also just take a look at this: https://codex.wordpress.org/Function_Reference/wp_get_current_user;
$current_user = wp_get_current_user();
Then you can do:
$current_user->user_login
instead of wp_get_current_user()->user_login
just in case. altho I think both would work.
Or you could just make your own theme and throw in the php 😉
The following tutorial changed my life forever and I’ll never look back to the days I used much of the dashboard page editor at all:
The ThemeShaper WordPress Theme Tutorial: 2nd Edition
<a href="<?php echo bp_loggedin_user_domain; ?>profile/">
<img src="http://mydomain.com/images/myprofile.png>
</a>
Well, I’m making progress…
I installed the plugin and now the code displays on the page… not executed, but just as it was typed. So it’s similar to putting bat ticks around it in this forum. I even checked the box that says allow execution of php in the plugin’s settings.
Thank you! I got it sorted out now… there were actually 2 places in the plugin that you had to check to execute the php.
I should be in great shape now!
I appreciate the help!