Forums

Join
bbPress Support ForumsTroubleshootingHow to have topic_author() show "display_name"?

Info

How to have topic_author() show "display_name"?

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

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

  3. You must log in to post.