Byline
Post author and post info
Last modified: May 11, 2023
Block name
t2/byline
Filters
Template
The full template returned by the render callback function can be overwritten using the t2/block/byline/template
filter.
Author
The filter t2/block/byline/author
has been added to replace the author name, for instance if using Co Authors Plus.
Author role
The block has a custom filter t2/block/byline/author_role
to override the author role value, if you want to dynamically get this value from user meta or another source.
Usage
\add_filter('t2/block/byline/author_role', function($role) {
if (!empty($role)) {
return $role;
}
return 'My Custom Role';
});
Author avatar
By default, when avatar display is enabled it gets the default profile avatar. You can override this with the t2/block/byline/author_avatar
filter.
Usage
\add_filter('t2/block/byline/author_role', function() {
return '<img src="" alt="" />';
});
Style properties
Small text color
- --t2-byline-color-small-text
- Theme.json: wp.custom.t2-byline.color.small-text
- Default: #767676
Avatar border radius
- --t2-byline-avatar-radius
- Theme.json: wp.custom.t2-byline.color.avatarRadius
- Default: 50%
Avatar size
- --t2-byline-avatar-size
- Theme.json: wp.custom.t2-byline.avatarSize
- Default: clamp(3rem,
Spacing
- --t2-byline-spacing
- Theme.json: wp.custom.t2-byline.color.small-text
- Default: 50%