Add the Author Bio After Posts in Block Themes
Automatically inserts the Author Biography block after the post content in your block theme's single post template, without editing the template.
Opens WPIDE on
Code
add_filter( 'hooked_block_types', function ( $hooked, $position, $anchor, $context ) {
if ( 'after' !== $position || 'core/post-content' !== $anchor ) {
return $hooked;
}
if ( ! $context instanceof WP_Block_Template || 'single' !== $context->slug ) {
return $hooked;
}
$hooked[] = 'core/post-author-biography';
return $hooked;
}, 10, 4 );
Notes
You can move or remove the inserted block in the Site Editor like any other block. Needs WordPress 6.4+.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.