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.

Get Posts

Adds a shortcode tag [get_posts] to display a list of posts within any static page or post.

This plugin adds the ability to put a shortcode tag in any static page or post and have it display a list of posts using the get_posts template tag.

By default it will show the 10 most recent posts ordered in reverse date order, but it will accept any of the options provided by the get_posts template tag.

To use it, just put the following into the HTML of any page or post, use as many times as you like on the same page:

[get_posts]

This default usage will return the last 10 posts in reverse chronological order. Along with all the options provided by the get_posts template tag, it will also accept a few additional options:

  • ul_class. This is the class assigned to the bullet list, with a default of "get_posts_class".
  • fields. This is a comma separated list of fields to show, taken right from the wp_posts database table fields. Some of the more interesting fields you can use in this list include post_title, post_date, and post_excerpt (you'll find more in the table description referenced above). The default is "post_title".
  • fields_classes. Another comma separated list that lets you assign a class to each of the fields specified above, which will be provided via a tag wrapped around the field. The default value for this list is "post_title_class".
  • fields_make_link. One more comma separated list that lets you choose which of your fields are links to the post. It is a list of either "true" or "false" values ... values of "true" make the corresponding field a link. The default is "true".

A couple of examples:

[get_posts tag="my favorite tag" numberposts=5 orderby="title]

Shows a bulleted list consisting of the titles of 5 posts with the tag "my favorite tag" ordered by title.

[get_posts tag="my favorite tag" fields="post_title, post_date, post_excerpt" fields_classes="class1, class2, class3" fields_make_link="true, false, false"]

Shows a bulleted list consisting of the titles, post dates, and excerpts of posts with the tag "my favorite tag". The title will be wrapped in a tag with a class of "class1", the date with a of class "class2", and the excerpt with "class3". Only the title will provide a link to the post.

Check the get_posts template tag documentation for all of the possible options associated with the tag, and the wp_posts database table fields for all possible field names.

Requires: 2.5.1 or higher
Compatible up to: 3.0.5
Last Updated: 2009-8-31
Downloads: 8,759

Ratings

4 stars
4.8 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,2,2
100,3,3 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1