Documentation, How To, & Examples

Shortcode Options - Retrieval

These are the parameters you can set in the shortcode that affect the selection of posts from the database.
categoryNo default. Enter the slug of the category you'd like to use. Separate multiple category slugs with commas.
numberpostsDefault is 1. This is the number of posts that are called in. To have no limit, use -1.
orderbyDefault is chosen in Global Settings. To override, add into shortcode. Options: post_date rand, title, post__in, etc.
orderDefault is ASC. Only other option is DESC. Used only when custom_field option is in use.
idsComma separated, specific ID(s) of post(s) to include. If you want to not specify a category, you can put category="byid" in the shortcode and only the posts with ids specified will be included.
post_typeDefault is post. The only other type you might want is a custom post_type.
category_taxIf you want to retrieve from a different taxonomy (other than category) you can enter specify it with this attribute. Note that this will only work with one item; you cannot enter multiple items separated by commas.
custom_fieldDefault is chosen in Global Settings, if not empty. Otherwise, ignored.

 

Shortcode Options - Group Display

These are the parameters you can set in the shortcode that affect the html and display of the posts that were retrieved.
templateNew as of Version 2.0!
Specifies a template to use for displaying the retrieved posts using the ID number of the template (example below). Note!!! If you specify a template using this parameter, then all of the "Individual Item Display" parameters below will be ignored except for thumbsize.
headingDefault = blank. This heading will be shown before the resulting list of posts, but only if the list is not empty.
headingtagDefault = h3. Can be any HTML tag name (b, i, u, h4, etc)

 

Shortcode Options - Individual Item Display

These are the parameters you can set in the shortcode that affect the html and display of the posts that were retrieved.
titleDefault is set in the "Global Settings". Can be any HTML tag name (b, i, u, h4, etc)
dateformatDefault is to not show the date. If you enter a dateformat for an instance of the shortcode (or above as a default for the whole site), the date will be shown preceding the title (if content_type is not title). Formatting tips.
classDefault = post. You can choose another class, for example, one controlled in your own theme's stylesheet, instead.
content_styleDefault = option set above. To override the default, set to one of these other options in the shortcode: excerpt, title.
linktitleDefault = true. If you don't want the post titles to be links (in excerpt or full mode), set this to false
separatorDefault is a comma (,). Only used if content_style is set to title. Any text you enter for this will be placed after each linked title. Special case: If you use <list>, the linked post titles will actually be enclosed in a UL and LIs.
showthumbEmpty and ignored by default. If set to true, then the post's featured image is displayed before the post (You choose the featured image at the bottom right on the Edit Post page). The image has the class attachment-thumbnail, so you can style it.
thumbsizeIf you set showthumb to true, you can also set the size. The default is medium. Other options include thumbnail or large. If you provide two numbers separated by a comma, those two numbers will be used as the width and height.
Want more?To display the remaining, infrequently used, parameters, click here

 

Shortcode Examples

prefix."term_taxonomy tt, ".$wpdb->prefix."terms t WHERE tt.taxonomy LIKE 'category' AND tt.term_id=t.term_id AND tt.term_id=1 ORDER BY t.slug"; $result = $wpdb->get_results($sql); foreach ($result as $i) $slugexample = $i->slug; ?>

If you want to call the 5 most recent posts in the category into a page, place this shortcode on the page:

[ahs_callposts category="" numberposts="5"]

 

If you want to call all posts in the category into a page but only list linkable titles with hard returns between them, place this shortcode on the page:

[ahs_callposts category="" numberposts="-1" content_style="title" separator="<br />"]

 

If you want to call the 10 most recent posts into a page using Template #3, place this shortcode on the page:

[ahs_callposts numberposts="10" template="3"]