Home My Plugins Latest Post Shortcode

Latest Post Shortcode

The plugin registers a configurable shortcode that allows you to create a dynamic content selection from your posts, pages, and custom post types by combining and filtering what you need.

What does it do?

The plugin registers a configurable shortcode that allows you to create a dynamic content selection from your posts, pages, and custom post types by combining and filtering what you need.

You can download the free plugin from the WordPress repository. If you would like to support my work, please leave a 5 stars rating, or share this plugin on your feed.
A huge thanks in advance!

Settings

The shortcode settings are:

  • Number of Posts: the number of items to display if there is no pagination.
  • Pagination: No pagination, Paginate results. For the paginate results, there are extra available options
    • Records Per Page
    • Offset
    • Navigation options: Hide Pages Navigation, Show Pages Navigation (range of 4 visible pages), Show Pages Navigation (range of 5 visible pages), Show Pages Navigation (range of 10 visible pages)
    • Pagination Position: Above the results, Below the results, Above & Below the results
  • Post Type*: the post types to be selected
  • Display Post: the details to display for each post. The options are: Title, Title + Post Excerpt, Title + Post Content, Title + Few Chars From The Excerpt, Title + Few Chars From The Content, Date, Title + Date, Title + Date + Post Excerpt, Title + Date + Post Content, Title + Date + Few Chars From The Excerpt, Title + Date + Few Chars From The Content, Date + Title, Date + Title + Post Excerpt, Date + Title + Post Content, Date + Title + Few Chars From The Excerpt, Date + Title + Few Chars From The Content.
  • Chars from excerpt/content: this will allow specifying the number of chars for the options that require a few chars,
  • Use Post URL: No link to the post, Link to the post, Link to the post (_blank)
  • Extra Options: Show post tags, Ajax Pagination
  • Order by: Date DESC, Date ASC, Menu Order ASC, Menu Order DESC, Title ASC, Title DESC
  • Status: filters the post statuses you want to be exposed (this is a dynamical option, the list of post statuses will include the native statuses and the post statuses registered in your application by the other plugins)
  • Use Image*: No image or one selected image size
  • CSS Class Selector: you can use the builtin two-columns or three-columns CSS classes, or you can create your own custom CSS and specify the selectors
  • Tile Pattern: order of the HTML tags (image, title, text, link). If you use the “No link to post” option, the tile patterns available are:

    And when using links to posts, the tile patterns are these (the links ranges are marked with red)

  • Select The Latest From Taxonomy
    • Taxonomy*
    • Term
  • Select The Latest Posts With The Tag
    • Tag
    • Dynamic: No, use the selected ones, or Yes, use the current post tags (this option is useful when you want to display related content on a page)
  • Select The Posts By IDs: you can specify the Post IDs
  • The Latest Posts By Parent IDs: you can specify the Parent IDs.

There are some other options that can be configured, for example, to exclude posts with specific tags. This option looks like exclude_tags="slug1,slug2"

* These features are dynamic, meaning that the drop downs options are populated with entities registered in your application.

You can download the free plugin from the WordPress repository. If you would like to support my work, please leave a 5 stars rating, or share this plugin on your feed.
A huge thanks in advance!

Extra Styling Tips

If you want to add your extra styling, here are some selectors for the elements:

The CSS title selector
.latest-post-selection article h1

The CSS date selector
.latest-post-selection article em

The CSS time selector
.latest-post-selection article em i

If you want to completely override the sample styles provided by the plugin, you can apply the custom-class (for example) in the shortcode “CSS Class Selector”, and the selector you should use would becomes similar to this
.latest-post-selection.custom-class

So, if for example, I would want to hide the time and display only the date, but only for a particular list of posts (you can embed more shortcodes in the same page), I would add in my styles this line
.latest-post-selection.custom-class article em i {
display: none;
}

If you want to transform your posts selections into a dynamic responsive slider, you can install the slider extension. You can find more about it at Latest Post Shortcode Slider Extension.

More details about the plugin options at Latest Post Shortcode Options Sample

If you would like to support my work, please consider making a donation / buy me a coffee, leave a 5 stars rating, or share this plugin on your feed.
A huge thanks in advance!

1.0.0