Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_the_topic_last_poster_name() not working?

  • @vegasparty607

    Participant

    Hello, I am trying to add the last posters name in my forums topic.php, but when i try to put in `bp_the_topic_last_poster_name()`, nothing appears.

    What am I doing wrong? thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @vegasparty607

    Participant

    bump

    @vegasparty607

    Participant

    bump?? anyone? :(

    @r-a-y

    Keymaster

    That function name is a little misleading, as bp_the_topic_last_poster_name() only works within the forum loop on the forum directory.

    You’ll have to write your own function to grab the last poster name in the topic loop try something like this in your theme’s functions.php:

    `
    function my_the_topic_last_poster_name() {
    echo my_get_the_topic_last_poster_name();
    }
    function my_get_the_topic_last_poster_name() {
    global $forum_template;

    if ( !$domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster ) )
    return __( ‘Deleted User’, ‘buddypress’ );

    return apply_filters( ‘my_get_the_topic_last_poster_name’, ‘‘ . $forum_template->topic->topic_last_poster_name . ‘‘ );
    }
    `

    Then in your topic.php, add the following:

    `
    `

    @vegasparty607

    Participant

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘bp_the_topic_last_poster_name() not working?’ is closed to new replies.
Skip to toolbar