# bbPress: "Topic Starter" Badge on Replies

> Adds a small "Topic starter" badge under the author's name on replies written by the person who opened the topic, making long threads easier to follow.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: bbpress, badges, topics
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/bbpress-topic-starter-badge/

## Code

```php
if ( ! function_exists( 'bbp_get_reply_author_id' ) ) {
    return;
}

add_action( 'bbp_theme_after_reply_author_details', function () {
    $reply_id  = (int) bbp_get_reply_id();
    $topic_id  = (int) bbp_get_reply_topic_id( $reply_id );
    $author_id = (int) bbp_get_reply_author_id( $reply_id );

    // The opening post itself is the topic, so only mark later replies.
    if ( ! $author_id || $reply_id === $topic_id || $author_id !== (int) bbp_get_topic_author_id( $topic_id ) ) {
        return;
    }

    echo '<span class="wpide-bbp-starter" style="display:inline-block;margin-top:.3em;padding:0 .5em;border-radius:999px;border:1px solid currentColor;font-size:.75em">Topic starter</span>';
} );
```

## Notes

Style the badge with the .wpide-bbp-starter class.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "bbPress: "Topic Starter" Badge on Replies" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
