Moka Get Posts Shortcode

Provides a [moka-get-posts] shortcode for displaying posts or pages using the get_posts function.

Author:Bob Matsuoka (profile at wordpress.org)
WordPress version required:3.1
WordPress version tested:3.2.1
Plugin version:1.0
Added to WordPress repository:24-05-2011
Last updated:24-05-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://www.mokamedianyc.com/dev/get-posts-sho...
Total downloads:2 535
Active installs:20+
plugin download
Click to start download

Provides a [moka-get-posts] shortcode for displaying posts or pages using the get_posts function. The shortcode accepts most parameters that you can pass to the get_posts() function. Additional arguments are: show_fields="post_content,post_excerpt,post_thumbnail" (use post properties; additional fields include post_thumbnail and post_permalink), thumbnail_size="large" (default: "thumbnail" to set post_thumbnail size), and permalink_title (default: "true" to wrap title in permalink). To show posts or pages, add [get-posts category="NN"] in the page or post body. To get pages, use the post_type parameter, e.g., [moka-get-posts post_type="page"]. You can also pass a template using shortcode content. Use the %post_title% format to have fields substituted. Substitution fields most be listed in the "show_fields" argument.

Note: unlike the get_posts function, this shortcode defaults to 99 items. Override using the numberposts attribute.

Please Note

The default values are the same as for the get_posts() function (http://codex.wordpress.org/Template_Tags/get_posts) with the following exceptions:

Standard Attributes 'numberposts' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_parent' => '',

Note: 'post_parent' also supports a non-standard "this" value, which will use the current post or page as its argument.

Non-Standard Attributes

'show_fields' => 'post_title',

Selects fields to include in output. By default, post_title is shown. Other options are: post_excerpt, post_content, post_thumbnail, post_permalink

'thumbnail_size' => 'thumbnail',

If 'post_thumbnail' is used in 'show_fields', this will determine the size of the thumbnail.

'permalink_title' => 'true',

If true, wrap post_title with post_permalink.

'class_name' => 'get-posts',

Can use an alternate classname for the wrapping div. Use if a template is not provided.


ChangeLog