A WordPress block that outputs a list of post authors.
The block supports the full array of design tools available, so you can also style these just like most other Core WordPress blocks via styles.blocks.x3p0/authors in theme.json. Here's an example:
{
"styles": {
"blocks": {
"x3p0/authors": {
"color": {
"text": "var(--wp--custom--color--foreground--default)"
},
"typography": {
"fontSize": "var(--wp--preset--font-size--md)",
"lineHeight": "var(--wp--custom--line-height--md)"
}
}
}
}
}An alternative to the theme.json method (or in addition to), you can load a block-specific stylesheet and work with plain ol' CSS. Here's an example of loading a themeslug/public/css/blocks/x3p0-authors.css stylesheet:
add_action('init', function() {
wp_enqueue_block_style('x3p0/authors', [
'handle' => 'themeslug-block-x3p0-authors',
'src' => get_theme_file_uri('public/css/blocks/x3p0-authors.css'),
'path' => get_theme_file_path('public/css/blocks/x3p0-authors.css')
]);
});And some CSS to overwrite the default custom CSS properties:
.wp-block-x3p0-authors {
/* Write some custom CSS. */
}X3P0: Authors is licensed under the GNU GPL, version 3 or later.
2022-2025 © Justin Tadlock.
