Skip to:
Content
Pages
Categories
Search
Top
Bottom

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

  • 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

Viewing 14 replies - 1 through 14 (of 14 total)
  • get_user_profile_link( $userid )

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

    This works on front-page.php:

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

    Trent

    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

    -bump-

    Any luck?

    This topic is old, fixed it ages ago :)

    Can you post how you fixed it?

    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

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

    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


    linickx
    Participant

    @linickx

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


    Burkie
    Participant

    @burkie

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

    the above gets the use profile for any page.

    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!

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Skip to toolbar