TPG Get Posts

0

Please review the Changelog for release change notices and save any custom styling before applying any upgrade. This plugin adds the ability to put a shortcode tag in a page or post and

Version
Last updated
Active installations
WordPress Version
Tested up to
Rating
Total ratings
Tag

Description

Please review the Changelog for release change notices and save any custom styling before applying any upgrade.

This plugin adds the ability to put a shortcode tag in a page or post and have it display posts formatted similarly to the standard blog. The posts can be selected by one or more tag values, suchs as tags, category or any other option supported by the WP get_posts function, to show only items relevant for the page. It will also support displaying the post titles as a list.

By default it will show the 5 most recent posts ordered in reverse date order,
but it will accept most of the options provided by the get_posts template tag. If the value of the paramter is an array, it must be parsed by the plugin and not all parms have been implemented.

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 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.

See the usage section in ‘Other Notes’ for a list of parms and more examples of use. Full documentation is on the plugin settings page or at the plugin website

As of version 3.6, all features are supported in the free version (please consider a donation):

  • extended cat__and, cat__not_in and cat__in and other taxonmy
  • the short code to be added to a text widget
  • extensive formating of the by line and meta-data line
  • a magazine layout option which displays the post header and text next to the post thumbnail
  • a featured image layout option
  • pagination (not supported in all themes) – This option is tested against the WP themes and a very limited set of plugins. There are a few sites that have reported pagination not working, but the problem has not been identified. It could be theme or plugin conflict. Due to the challenges of implementing pagination in various site configurations, support for this option cannot be provided.

NOTE
The 3.0 release alters the default for thumbnails. If this upgrade breaks your site, download tag 2.5.0 and set the option to freeze the release. Be sure to test before upgrading.

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"]