Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to have topic_author() show “display_name”?


  • intellivision
    Participant

    @intellivision

    On front-page.php I’d like the “first poster” column to show the users’ display_name (bbPress is synced with WP).

    I’ve tried this

    <td class="num"><?php echo(get_author_name(topic_author())); ?></td>

    which calls this

    function get_author_name( $auth_id ) {
    $authordata = get_userdata( $auth_id );
    return $authordata->display_name;
    }

    but it still shows “user_login” which tend to have ugly underscores etc.

Viewing 1 replies (of 1 total)

  • _ck_
    Participant

    @_ck_

    You can use str_replace in php to get rid of the underscores or probably find the nicename function in wordpress and filter through that.

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