A long-time feature of Genesis is what is called an ‘author box’. This is a box that corresponds to an author and includes:
- a heading of ‘About Brian Gardner’, where ‘Brian Gardner’ is the author’s preferred name
- the author’s picture, which is the Gravatar associated with his/her email address
- the author’s biographical info.
Genesis gives you full control over the output of the author box, via the filter
The filter to use is
genesis_author_box. The entire marked up content of the author box passes through this filter immediately before echoing or returning it.
You can use the filter to tweak the content using PHP string functions. As an example, the below code changes any H1 element to H2.
Or, replace the author box altogether:
For more granular control, you can use the arguments that are bundled with the filter (see further below for details).
$output – the entire marked up content of the author box at the time of your filter being processed. It may vary depending on the priority you specify if other filters are applied, but none are applied by default.
$context – the context in which the author box is being included. The usual contexts are
single for single Posts and
archive for author archives.
$pattern – the default markup structure of the author box with
%s in place of the picture, author name and biographical info respectively. See the default markup structure above.
$gravatar – the HTML image for the author’s picture or Gravatar.
$title – the author box title, after being filtered with
$description – the author’s biographical info.
Default Markup Structure
The author box default markup structure for HTML5 is as follows:
The author box default markup structure for HTML5 (single context) is as follows:
The author box default markup structure for XHTML is as follows:
The author box default markup structure for XHTML (single context) is as follows:
Note on Markup Structure
If the author box is used on an author archive that also includes an archive headline, the single context version of the author box is used instead. The reason is because the archive headline also adds an H1 element and there should only be one H1 element in the document.
The same thing will also happen if your child theme supports accessible headings, because this automatically adds an archive headline to author archives.
There are no filters applied to
genesis_author_box by default.
If you hard-code information on a specific author into this filter, it will take effect on the author box for any author on your website. To avoid this, use
genesis_author_box is located in lib/structure/post.php.
- How to Output an Author Box with Genesis
- How to Edit the Author Box Title with Genesis
- How to Edit the Author Box Gravatar Size with Genesis
- How to Add Archive Headlines and Intro Text with Genesis
- How to Make an Accessible Child Theme with Genesis
Relevant tutorials from the Genesis community.