WordPress.org

Plugin Directory

TPG Get Posts

Display posts on a page with ability to filter category or tag.

Usage

WARNING If you copy/paste the commands, the function may not work. If this happens, type the entire command in to avoid introducing hidden characters.

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:

[tpg_get_posts]

this is equivalent to:

[tpg_get_posts fields="title,byline,content,metadata"
fields_classes="post_title=tpg-title-class,
post_content=tpg-content-class,post_byline=tpg-byline-class,
post_metadata=tpg-metadata-class" numberposts=5 ]

This default usage will return the last 5 posts in reverse chronological order. It will display the post similarly to a standard post, honoring the tag to produce a teaser. Meta data showing post date, author, modified date, comments, categories and tags is also displayed.

A common usage is to show post on a page that have a common tag or category:

    [tpg_get_posts tag="tag1, tag2,tag3"]
or
    [tpg_get_posts cat="catname1, catname2, catname3,catid,slug"]

See Settings in plugin for full list of parameters

A couple of examples:

Show 5 posts with the tag "tag1" or "tag2" ordered by title. Display the post title and content teaser.

[tpg_get_posts tag="tag1,tag2" numberposts=5 orderby="title]

Show 2 posts with the category name of "Events" or "News" ordered by title. Display the post title and the entire content.

[tpg_get_posts cat="Events,News" numberposts=2
orderby="title show_entire="true"]

Show a bullet list of post titles. The title will be wrapped in a of class "p-ul-class". The title will provide a link to the post. The title can be formatted with a css style .p-ul-class h2 {}.

[tpg_get_posts tag="tag5" fields="title" ul_class="p-ul-class"]

Requires: 2.8 or higher
Compatible up to: 4.2.2
Last Updated: 2015-7-6
Active Installs: 5,000+

Ratings

4.6 out of 5 stars

Support

4 of 8 support threads in the last two months have been resolved.

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,1,1
100,1,1
100,1,1 100,1,1
100,2,2
0,2,0
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1
100,1,1