# Author Box After Posts

> Adds a box with the author avatar, name, biography and a link to their other posts at the end of single posts. Authors without a biography are skipped.

- Type: PHP
- Runs: Frontend only
- Category: [Content](https://wpide.com/library/category/content/)
- Tags: content, author, bio
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/author-box-after-posts/

## Code

```php
add_filter( 'the_content', function ( $content ) {
    if ( ! is_singular( 'post' ) || ! in_the_loop() || ! is_main_query() ) {
        return $content;
    }

    $author_id = (int) get_post_field( 'post_author', get_the_ID() );
    $bio       = (string) get_the_author_meta( 'description', $author_id );

    if ( '' === trim( $bio ) ) {
        return $content;
    }

    $box  = '<div class="wpide-author-box" style="display:flex;gap:16px;align-items:flex-start;margin-top:2em;padding:16px;border:1px solid rgba(0,0,0,.1);border-radius:6px;">';
    $box .= get_avatar( $author_id, 72 );
    $box .= '<div><p style="margin:0 0 .4em;"><strong>' . esc_html( get_the_author_meta( 'display_name', $author_id ) ) . '</strong></p>';
    $box .= '<p style="margin:0;">' . wp_kses_post( $bio ) . '</p>';
    $box .= '<p style="margin:.4em 0 0;"><a href="' . esc_url( get_author_posts_url( $author_id ) ) . '">More posts by this author</a></p></div></div>';

    return $content . $box;
}, 20 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Author Box After Posts" 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/
