Shortcodes are a feature, supported by WordPress, and used in many plugins for easily displaying more complex site elements. The Genesis Theme Framework comes with a number of handy shortcodes which can be used in a variety of ways on your site. These shortcodes are often used to customize specific areas of your site such as the Post Info(byline), Post Meta, and the Credits line in the footer of your site.
Genesis Specific Shortcodes
Post Shortcodes
Below is a list of shortcodes that can be used for in the post-info and post-meta sections.
[post_date]
This function produces the date of post publication.
list of attributes for this short code:
- format – The format for the date. Defaults to the date format configured in your WordPress options.
- before – Text/markup to place before the post date.
- after – Text/markup to place after the post date.
- label – Text to place before the post date.
Example:
Output:
[post_time]
This function produces the time of post publication.
list of attributes for this short code:
- format – The format for the time. Defaults to the time format configured in your WordPress options.
- before – Text/markup to place before the post time.
- after – Text/markup to place after the post time.
- label – Text to place before the post time.
Example:
Output:
Note: More information on formatting date and time can be found here.
[post_author]
This function produces the author of the post (display name)
list of attributes for this short code:
- before – Text/markup to place before the post author name.
- after – Text/markup to place after the post author name.
Example:
Output:
[post_author_link]
This function produces the author of the post (link to author URL)
list of attributes for this short code:
- nofollow – assign nofollow to the rel attribute in the link to the author. By default is set to
FALSE
- before – Text/markup to place before the post author link.
- after – Text/markup to place after the post author link.
Example:
Output:
[post_author_posts_link]
This function produces the author of the post (link to author archive)
list of attributes for this short code:
- before – Text/markup to place before the post author link.
- after – Text/markup to place after the post author link.
Example:
Output:
[post_comments]
This function produces the comment link.
list of attributes for this short code:
- zero – Text to display if zero comments on the post
- one – Text to display if one comment on the post
- more – Text to display if more than one comment on the post
- hide_if_off – Disable comment link even if comments is enabled.
- before – Text/markup to place before the post comment link.
- after – Text/markup to place after the post comment link.
Example:
Output:
No Comments: Leave a Comment
1 Comment: 1 Comment
Multiple Comments: 7 Comments
[post_tags]
This function produces the tag link list
list of attributes for this short code:
- sep – Separator between post tags
- before – Text/markup to place before the tag list. Default “Tagged With: “
- after – Text/markup to place after the tag list.
Example:
Output:
[post_categories]
This function produces the category link list
list of attributes for this short code:
- sep – Separator between post categories
- before – Text/markup to place before the post category list. Default “Filed Under: “
- after – Text/markup to place after the post category list.
Example:
Output:
[post_edit]
This function produces the edit post link for logged in users
list of attributes for this short code:
- link – Text for edit link. Default “(Edit)”
- before – Text/markup to place before the edit post link. Default “Filed Under: “
- after – Text/markup to place after the edit post link.
Example:
Output: A link to the edit post/page screen for that post will be displayed only for logged in users with a role that permits editing.
Footer Shortcodes
Below is a list of shortcodes that can be used in the site footer.
[[footer_backtotop]]
This function produces the “Return to Top” link
list of attributes for this short code:
- text – Default: “Return to top of page”
- href – assign to which div this link is anchored. Default: #wrap
- nofollow – assign nofollow to the rel attribute in the link to backtop. Default set to true.
- before – Text/markup to place before the “Return to Top” link.
- after – Text/markup to place after the “Return to Top” link.
Example:
[footer_backtotop text="Top" href="#content"]
Output: [footer_backtotop text=”Top of post” href=”#content”]
[footer_copyright]
This function produces the copyright.
list of attributes for this short code:
- copyright – Default:
©
- before – Text/markup to place before the copyright.
- after – Text/markup to place after the copyright.
Example:
© 2024
Output: © 2024
[footer_childtheme_link]
This function produces the childtheme link.
list of attributes for this short code:
- before – Text/markup to place before the childtheme link. Default:
·
- after – Text/markup to place after the childtheme link.
Example:
Output: •Prose Theme
Note: Must be supported by Child Theme
[footer_genesis_link]
This function produces the genesis theme link.
list of attributes for this short code:
- before – Text/markup to place before the genesis theme link.
- after – Text/markup to place after the genesis theme link.
Example:
Output: Genesis Framework
[footer_studiopress_link]
This function produces the studiopress link.
list of attributes for this short code:
- before – Text/markup to place before the studiopress link. Default: “by”
- after – Text/markup to place after the studiopress link.
Example:
by StudioPress
Output: by StudioPress
[footer_wordpress_link]
This function produces the wordpress link.
list of attributes for this short code:
- before – Text/markup to place before the wordpress link.
- after – Text/markup to place after the wordpress link.
Example:
[footer_loginout]
This function produces the log in/out link.
list of attributes for this short code:
- redirect – set redirect to a URL on login.
- before – Text/markup to place before the log in/out link.
- after – Text/markup to place after the log in/out link.
Example:
Leave a Reply