WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't 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.

Moka Get Posts Shortcode

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

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.

Requires: 3.1 or higher
Compatible up to: 3.2.1
Last Updated: 2011-5-24
Downloads: 1,546

Ratings

4 stars
4 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,3,3
100,1,1