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 list of all the tags assigned to a Post and makes them clickable to their respective archives.
The shortcode to produce a clickable tags list is
This shortcode is employed by default in the entry meta, but you can actually use it wherever you like, such as the Post title, the Post body or the entry meta before the content.
As an example, below is the code to display the tag list before the content instead of after the content.
You can use the
after attributes to add extra text immediately before or after the tag list. The default text before the tag list is ‘Tagged With: ‘.
You can also change the separator between the tags. The default is a comma and a space.
before – Text to insert immediately before the tag list.
Default: Tagged With:
after – Text to insert immediately after the tag list.
sep – The value of this attribute is inserted between all the tags to separate them.
Default: comma + space
[post_tags] outputs the following in order:
<span class="entry-tags">(HTML5) or
- the text passed to the before attribute, if any (default is ‘Tagged With: ‘)
- the tag list
- the text passed to the after attribute, if any
There is one filter on the output of this shortcode, which is
genesis_post_tags_shortcode. The entire marked up tags list passes through this filter before being output.
Genesis Simple Edits
[post_tags] has been included since version 1.1.0.
[post_tags] is located in lib/shortcodes/post.php.