Info
- 15 posts
- 7 voices
- Started 5 years ago by Null
- Latest reply from anandasama
- This topic is not a support question
get_topic_author() but how to get it's profile link?
-
- Posted 5 years ago #
Hi,
With this I get the topic author name:
get_topic_author(), but how do I get his profile link?get_topic_author_link()doesn't work...Any ideas?
thx
-
- Posted 5 years ago #
get_user_profile_link( $userid ) -
- Posted 5 years ago #
This doesn't work cause $userid isn't defined (i want to put this in front-page.php)
Got this:
<?php printf(__('%1$s - <a href="%2$s">%3$s</a>'), get_topic_time(), get_user_profile_link($userid), get_topic_author()) ?>All is in a for each loop, i get the author but no link to his profile :(
-
- Posted 5 years ago #
This works on front-page.php:
<a href="<?php user_profile_link($topic->topic_last_poster) ?>"><?php topic_last_poster(); ?></a>Trent
-
- Posted 5 years ago #
Close but still not there. I had to add get_ infront of it in order to work. Now this works AS LONG AS you have no replies on your topic. I wanted to get the authors profile link and not all authors of every reply....
I am making a list of posts on the front page that looks like this:
Topic title - author - postst - last reply byTo get the authors name i use: get_topic_author() this works and if i use:
<?php printf(__('<a href="%2$s">%3$s</a>'), get_user_profile_link($topic->topic_last_poster), get_topic_author()) ?>it works and I get the authors profile link. But as soon as I get a reply, it will show the profile link of the last poster and not the author (while the author name stays correct).Things like:
get_user_profile_link($topic->topic_author), get_topic_author()doesn't work.So the author is the topic starter, not the last topic poster
Null
-
- Posted 5 years ago #
-bump-
-
- Posted 5 years ago #
Any luck?
-
- Posted 5 years ago #
This topic is old, fixed it ages ago :)
-
- Posted 5 years ago #
Can you post how you fixed it?
-
- Posted 5 years ago #
Sure, I needed this for my bbPortal plugin (www.bbportal.org). The code for this is for the profilelink:
get_user_profile_link($topic->topic_poster), for the poster name:get_topic_author().To be honest, I am not sure if this will work OUTSIDE the bbPortal plugin. If not, just check the plugin and perhaps you can strip it...
Let em know
Null
-
- Posted 5 years ago #
get_user_profile_link($topic->topic_poster) doesn't work. :(
-
- Posted 5 years ago #
Yeah hmm was afraid of that. It's part of a function I've made with a foreach etc etc
There are 3 options:
1) Request this as a new function/option in the next release of bbPress
2) Make a new function :)
3) I/ someone else makes the function when I/he/she has the timeI will take a look at it tonight
-
- Posted 5 years ago #
I might be miss reading this, but I think I stumbled across this.
-
- Posted 4 years ago #
<a href="<?php user_profile_link(get_post_author_id()) ?>"><?php post_author(); ?></a>the above gets the use profile for any page.
-
- Posted 2 years ago #
I still dont know if you people managed to fix this but here is what worked for me after alot of trial and error:
From the first-page:
This code will generate a link to the original author's profile and that one's username.
<a href="<?php user_profile_link(($topic->topic_poster)) ?>"><?php topic_author(); ?></a>And this code will make a link to the last user who posted and that one's username.
<a href="<?php user_profile_link($topic->topic_last_poster) ?>" class="latest-disc-last-poster"><?php topic_last_poster(); ?></a>Hope it helps!
-
You must log in to post.