Forums

Join
bbPress Support ForumsTroubleshootingget_topic_author() but how to get it's profile link?

Info

get_topic_author() but how to get it's profile link?

  1. 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

  2. get_user_profile_link( $userid )

  3. 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 :(

  4. This works on front-page.php:

    <a href="<?php user_profile_link($topic->topic_last_poster) ?>"><?php topic_last_poster(); ?></a>

    Trent

  5. 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 by

    To 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

  6. -bump-

  7. Any luck?

  8. This topic is old, fixed it ages ago :)

  9. Can you post how you fixed it?

  10. 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

  11. get_user_profile_link($topic->topic_poster) doesn't work. :(

  12. 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 time

    I will take a look at it tonight

  13. I might be miss reading this, but I think I stumbled across this.

  14. <a href="<?php user_profile_link(get_post_author_id()) ?>"><?php post_author(); ?></a>

    the above gets the use profile for any page.

  15. 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!

  16. You must log in to post.