Info
- 6 posts
- 2 voices
- Started 1 year ago by BrianStevens
- Latest reply from gerikg
- This topic is not resolved
WordPress MU/BP Integration: post_author_link issue
-
- Posted 1 year ago #
Hello,
I have just completed integrating bbPress into my WordPress MU installations. Buddypress is also installed, but I have not taken other steps in order to integrate Buddypress with bbPress significantly. It works really well: when a user signs up on WordPress, they appear as a user in bbPress.
I have only run into one problem, which is this.
On post.php in my theme file, I use <?php post_author_link(); ?> as a link the author's profile. By my understanding, this should link to the Buddypress profile without any additional set up. Instead, when I click the link it goes to the post author's site as defined in the user's Profile in the WordPress Admin Dashboard. I want post_author_link to go to their Buddypress profile, not an external website. Obviously their Buddypress profiles are more important since the site focuses on community. Linking to an external site will detract from that quite greatly.
Thank you for any help on this matter.
-
- Posted 1 year ago #
try this:
I had a better solution but I can't remember it now. The code above only works if bbpress is in wordpress folder which 99% of people do.
-
- Posted 1 year ago #
Close, but the code was slightly off, and I was able to adjust it to my needs.
Thanks! :)
-
- Posted 1 year ago #
Alright, it turns out I was a bit preemptive in declaring "Mission Accomplished."
I modified your code because it originally didn't work. Here is where I am stuck.
Now, the link shows up formatted correctly, but it links to the wrong page and then redirects home.
You see, post_author calls up the user's Display Name, not their username, which is what post_author calls.
So that links to http://www.example.com/members/Brian Stevens, rather than http://www.example.com/members/bstevens
Does anyone know the code to call the username, rather than display name? post_author_id also did not work. I'm not sure how to call their account name.
-
- Posted 1 year ago #
sorry I was missing something...
-
- Posted 1 year ago #
echo get_user_name(get_post_author_id());
-
You must log in to post.