Overview
Blox includes a number of shortcodes, which allow you to easily add content to image captions and other content areas. The following list of shortcodes will continue to grow. This is just the beginning!
Page Title
[blox-page-title before="" after="" singular_only=""]
This shortcode prints out the current page’s title so long as the page is a singular page, i.e. a post, page, or custom post type. The shortcode uses the WordPress function get_the_title()
. This function can produce some unexpected output on archives and other non-singular pages depending on where the block is positioned on the page. See the singular_only attribute below.
before: Defaults to none. Allows you to add html before the page title.
after: Defaults to none. Allows you to add html after the page title.
singular_only: Defaults to none. Only accepts singular_only="true"
. Allows you to disable the shortcode when it is displayed on non-singular pages, such as archive pages.
Archive Title
[blox-archive-title before="" after=""]
This shortcode prints out the current page’s title so long as the page is an archive page. The shortcode uses the WordPress function get_the_archive_title()
. This shortcode will not display anything if it is placed on a singular page.
before: Defaults to none. Allows you to add html before the page title.
after: Defaults to none. Allows you to add html after the page title.
Last Modified Date
[blox-modified-date format="" before="" after="" singular_only=""]
This shortcode prints out the date and time the current page was last modified. The shortcode only works on singular pages (i.e. a post, page, or custom post type) since only they can be directly edited. The shortcode uses the WordPress function get_the_modified_date( $format )
. This function can produce some unexpected output on archives and other non-singular pages depending on where the block is positioned on the page. See the singular_only attribute below.
format: Defaults to the ‘Date Format’ setting located on your website’s Settings > General panel. This attribute can be changed using PHP date/time notation. For example, format="l, F j, Y"
would generate something like Friday, March 11, 2016.
before: Defaults to none. Allows you to add html before the modified date.
after: Defaults to none. Allows you to add html after the modified date.
singular_only: Defaults to none. Only accepts singular_only="true"
. Allows you to disable the shortcode when it is displayed on non-singular pages, such as archive pages.
Note: This shortcode is actually used on this very page! At the top of the page there is a global block that prints the last time this documentation page was modified.
Published Date
[blox-published-date format="" before="" after="" singular_only=""]
This shortcode prints out the date and time the current page was published. The shortcode only works on singular pages (i.e. a post, page, or custom post type) since only they can be directly edited. The shortcode uses the WordPress function get_the_date( $format )
. This function can produce some unexpected output on archives and other non-singular pages depending on where the block is positioned on the page. See the singular_only attribute below.
format: Defaults to the ‘Date Format’ setting located on your website’s Settings > General panel. This attribute can be changed using PHP date/time notation. For example, format="l, F j, Y"
would generate something like Friday, March 11, 2016.
before: Defaults to none. Allows you to add html before the published date.
after: Defaults to none. Allows you to add html after the published date.
singular_only: Defaults to none. Only accepts singular_only="true"
. Allows you to disable the shortcode when it is displayed on non-singular pages, such as archive pages.
Author Meta
[blox-author meta="display_name" before="" after="" singular_only=""]
This shortcode retrieves information about the author that created the current page. It was originally designed to return the name of the author, but it can do quite a bit more than that. The shortcode only works on singular pages (i.e. a post, page, or custom post type) since only they can be directly edited. The shortcode uses the WordPress function the_author_meta( $field )
. This function can produce some unexpected output on archives and other non-singular pages depending on where the block is positioned on the page. See the singular_only attribute below.
field: Defaults to display_name
. This parameter can accept the following parameters:
user_login
user_pass
user_nicename
user_email
user_url
user_registered
user_activation_key
user_status
display_name
nickname
first_name
last_name
description
jabber
aim
yim
user_level
user_firstname
user_lastname
user_description
rich_editing
comment_shortcuts
admin_color
plugins_per_page
plugins_last_view
ID
Additional information can be found in the WordPress Codex entry for the the_author_meta( $field )
function.
before: Defaults to none. Allows you to add html before the author meta.
after: Defaults to none. Allows you to add html after the author meta.
singular_only: Defaults to none. Only accepts singular_only="true"
. Allows you to disable the shortcode when it is displayed on non-singular pages, such as archive pages.
Categories List
[blox-categories-list separator="" before="" after="" singular_only=""]
This shortcode prints a list of all the categories of the current post. It should only be used on singular posts and post archives. The shortcode uses the WordPress function get_the_categories_list( $separator )
. This function can produce some unexpected output on archives depending on where the block is positioned on the page. See the singular_only attribute below.
separator: Defaults to no separator. Example usage would be something like ", "
which would make the list comma separated.
before: Defaults to none. Allows you to add html before the published date.
after: Defaults to none. Allows you to add html after the published date.
singular_only: Defaults to none. Only accepts singular_only="true"
. Allows you to disable the shortcode when it is displayed on non-singular pages, such as archive pages.
Tags List
[blox-tags-list separator="" before="" after="" singular_only=""]
This shortcode prints a list of all the tags of the current post. It should only be used on singular posts and post archives. The shortcode uses the WordPress function get_the_tags_list( $separator )
. This function can produce some unexpected output on archives depending on where the block is positioned on the page. See the singular_only attribute below.
separator: Defaults to no separator. Example usage would be something like ", "
which would make the list comma separated.
before: Defaults to none. Allows you to add html before the published date.
after: Defaults to none. Allows you to add html after the published date.
singular_only: Defaults to none. Only accepts singular_only="true"
. Allows you to disable the shortcode when it is displayed on non-singular pages, such as archive pages.