The tpc_get_hyperlist() Template Tag

A Template Tag is a function that can be called from within any of your website's Template Files, usually to display information dynamically.

tpc_get_hyperlist() is the only Template Tag provided by The Permalinks Cascade, and can be used to display a hyper-list wherever in a Template File. Its signature is the following:

function tpc_get_hyperlist( $type, $arguments = array() );

It works much like the [permalinks-cascade] shortcode, in fact for each type of hyper-list a different set of arguments is available. In the next sections you can find details about these dynamic arguments.

Parameters

$type

(string)(Required) Identifies the kind of hyper-list, and it is always a singular word.

Valid values: post, page, {custom_post_type_key}, post_tag, category, {custom_taxonomy_key}, author.

$arguments

(array)(Optional) Collection of key-value pairs controlling the content of the hyper-list. For each value of $type passed in to the Template Tag, a whole new set of arguments can be set out.

Return

(string) The hyper-list to display.

Arguments Common to All Types of Hyper-list

title

Description: the title of the hyper-list. The title is tagged with an <h3> heading tag, and included in the <div> container wrapping the hyper-list.

Default value: the name of the content type, generally in the plural.

show_title

(true/false) Whether or not to show the title of the hyper-list.

Default value: true

limit

Description: the maximum number of items to show in the hyper-list.

Valid values: a positive integer up to 1000.

Default value: 100

Arguments Common to Hyper-lists of Type 'post', 'page' and {custom_post_type_key}

exclude

Description: comma-separated record of Posts, Pages or Custom Posts IDs to exclude from the hyper-list.

Valid values: comma-separated list of positive integers.

include_only

Description: whitelist of IDs. Every Post, Page or Custom Post out of this record doesn't show up in the hyper-list.

Valid values: comma-separated list of positive integers.

When $type is 'post'

group_by

Description: tells The Permalinks Cascade whether and how to group Posts.

Valid values: none, date, category, author

Default value: none

hyperlink_group_title

(true/false) Whether or not to hyperlink the title of each group. Posts have to be grouped via the group_by argument in order for The Permalinks Cascade to take this argument into account.

Default value: true

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of Posts.

Valid values: post_date, post_date_asc, comment_count, post_title

Default value: post_date

pop_stickies

(true/false) Whether or not to stick featured Posts to the top of the hyper-list.

Default value: false

show_excerpt

(true/false) Whether or not to show for each Post a short excerpt.

Default value: false

excerpt_length

Description: sets the maximum number of characters (whitespaces included) making the excerpt shown for each Post. The show_excerpt argument has to be set to true in order for The Permalinks Cascade to take this argument into account.

Valid values: a positive integer between 50 and 300.

Default value: 100

show_comments_count

(true/false) Whether or not to show for each Post the date of publication.

Default value: false

When $type is 'page'

show_home

(true/false) Whether or not to show a "Home" link on top of the hyper-list.

Default value: false

hierarchical

(true/false) Whether or not to show a hierarchical hyper-list of Pages.

Default value: true

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of Pages.

Valid values: menu_order, title

Default value: menu_order

group_by_topic

(true/false) Tells The Permalinks Cascade whether or not to group Pages by Topic.

Default value: false

show_topicless

(true/false) Tells The Permalinks Cascade whether or not to show Pages without a Topic.

Default value: false

exclude_children

(true/false) Whether or not to exclude all the child Pages from the hyper-list.

Default value: false

only_children_of

Description: ID of a parent Page. The Permalinks Cascade will show a hyper-list of Pages children of the chosen page.

Valid values: a positive integer.

dehyperlink_parents

(true/false) Whether or not to disable the hyperlinking of parent Pages.

Default value: false

dehyperlinking_level

Description: tells The Permalinks Cascade up to which level of nesting a hierarchical hyper-list of Pages has to have its parent items de-hyperlinked. The dehyperlink_parents argument has to be set to true in order for the plugin to take this argument into account.

Valid values: 0, 1, 2

Default value: 0

When $type is {custom_post_type_key}

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of Custom Posts.

Valid values: post_title, post_date, post_date_asc

Default value: post_title

hierarchical

(true/false) Whether to show a hierarchical or flat hyper-list of Custom Posts. This argument is available only for hierarchical Custom Post Types.

Default value: true

When $type is 'post_tag'

show_count

(true/false) Whether or not to show the number of Posts published under each Post Tag.

Default value: false

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of Post Tags.

Valid values: name, count

Default value: name

When $type is 'category'

show_count

(true/false) Whether or not to show for each Category the number of published Posts.

Default value: true

feed_text

Description: Text of the link to each Category's RSS feed. When no text is specified, the link is hidden.

Default value: empty string.

hierarchical

(true/false) Whether to show a hierarchical or flat hyper-list of Categories.

Default value: true

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of Categories.

Valid values: name, count

Default value: name

When $type is {custom_taxonomy_key}

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of Terms.

Valid values: name, count

Default value: name

hierarchical

(true/false) Whether to show a hierarchical or flat hyper-list of Terms. This argument is available only for hierarchical Taxonomies.

Default value: true

When $type is 'author'

show_count

(true/false) Whether or not to show the number of Posts published by each author.

Default value: true

show_avatar

(true/false) Whether or not to show the author's avatar.

Default value: false

avatar_size

Description: the width (or height) in pixels of the square picture used as avatar. The show_avatar argument has to be set to true in order for The Permalinks Cascade to take this argument into account.

Valid values: a positive integer between 20 and 512.

Default value: 60

show_bio

(true/false) Whether or not to show the biographical information set in the author's profile page.

Default value: false

order_by

Description: tells The Permalinks Cascade how to order the hyper-list of authors.

Valid values: display_name, posts_count

Default value: display_name

Last update: