The Genesis Framework bundles a number of useful shortcodes that allow you to access and output important pieces of information quickly. One of these produces a credit to the author of a Post or Page and makes it clickable to that author’s archive.
An extra benefit is that if you’re on an HTML5 Genesis theme, this shortcode not only produces a clickable author link but also marks it up with semantic schema.org microdata.
The shortcode to produce a clickable author link is
This shortcode is employed by default in the entry meta, but you can actually use it wherever you like, such as the Post or Page title, the Post or Page body or the entry meta after the content.
As an example, below is the code to display the clickable author link after the content instead of before the content.
before – Text to insert immediately before the clickable author link.
after – Text to insert immediately after the clickable author link.
[post_author_posts_link] outputs the following in order:
<span class="entry-author" itemprop="author" itemscope itemtype="http://schema.org/Person">(HTML5) or
<span class="author vcard">(XHTML)
- the text passed to the before attribute, if any
<a href="#" class="entry-author-link" itemprop="url" rel="author">(HTML5, where
#is the permalink to the author archive) or
<span class="entry-author-name" itemprop="name">(HTML5) or
<a href="#" rel="author">(XHTML, where
#is the permalink to the author archive)
- The author’s preferred name, as per their profile settings
- the text passed to the after attribute, if any
There is one filter on the output of this shortcode, which is
genesis_post_author_posts_link_shortcode. The entire marked up author link passes through this filter before being output.
Genesis Simple Edits
[post_author_posts_link] has been included since version 1.1.0.
[post_author_posts_link] is located in lib/shortcodes/post.php.