Primary

Shortcodes

[documentation_documents]

Lists documents and is the equivalent to the Documents widgets.

Attributes:

  • category_id : Show documents in a category. The value of the attribute can be empty, a document category ID or {current}.
  • number : Defaults to -1 to display an unlimited number of documents, or indicate any number to limit the number of documents to display.
  • order : Use ASC or DESC to show documents in ascending or descending order.
  • orderby : What criterion is used to sort the documents listed. Defaults to title and can be name, author, date, title, modified, menu_order, parent, id, rand (for random order) and comment_count (sort by number of comments related to a document).
  • show_author : Whether to show the author or not, possible values are “yes” and “no” (default).
  • show_comment_count : Whether to show the number of comments, possible values are “yes” and “no” (default).
  • show_date : Whether to show the document’s date, possible values are “yes” and “no” (default).

[documentation_hierarchy]

This is the shortcode-equivalent to the Document Hierarchy widget, providing a means of navigating the documentation structure.

Attributes:

  • root_depth : number of levels to include from the root level, defaults to 1 including all documents at root level (without parents); set to 0 to hide all documents at root level except the parent of the current document
  • supernode_height : number of levels to include above the current document, defaults to 1
  • supernode_subnode_depth : number of levels to include below each supernode, defaults to 1
  • subnode_depth : number of levels to include below the current document, defaults to 1

[documentation_list_children]

This is the shortcode-equivalent to the Document Children widget.

Attributes:

See wp_list_pages as this shortcodes uses this function to render the children. All except the post_type and echo attributes which are fixed are supported.

Note that the child_of attribute can be used to render children for the currently displayed document by indicating {current} as its value. Example:

[documentation_list_children child_of="{current}"]

… which would be a very common use case for this shortcode.

[documentation_search_form]

Renders a dynamic search form. The form provides search results in the form of links to documents, while the user types in the form’s search field.

Attributes:

  • content : enable or disable searching in content; disabled by default, “yes” enables
  • excerpt : enable or disable searching in excerpts; disabled by default, “yes” enables
  • limit : number of search results, defaults to 10
  • order"ASC" or "DESC" for ascending or descending order
  • order_by"title" (default), "date""ID" or "rand" (for random order)
  • title : enable or disable searching in titles; enabled by default, “no” disables

[documentation_categories]

This shortcode renders a list of links to the document categories. Use it to display all or part of your document categories and help your users to list their related documents by clicking on the links that are rendered for each category.

Attributes:

  • child_of : Use this option to indicate a category id and show its children; by default this is empty, showing all categories.
  • depth : This is used to indicate the number of levels to include from the root level. It defaults to "0" (zero) including all categories at root level (this option only works when hierarchical is enabled).
  • hide_empty : Use this to hide or show empty categories; the default is “yes” hiding document categories that have no related documents. Use "no" to also show document categories that are empty.
  • hierarchical : Determines whether the list is flat or shows child document categories indented (like a tree). The default is "yes", indicate "no" to show a flat list.
  • order : Can be “ASC” or “DESC” for ascending or descending order.
  • orderby : Allowed values are "name", "slug", "id" and "description". The document categories shown will be sorted based on that.
  • show_count : Use this to show the number of documents in each document category. The default is "no", use "yes" to show the counts.

Example. To show all document categories up to the second level (i.e. including also children of the root categories) in a hierarchy, to include empty categories and to show the document count per category, use:

[documentation_categories depth="2" hide_empty="no" show_count="yes"]