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.

Download plugin from WordPressThe shortcode can be generated very easy, the plugin will add a shortcode button for this in the editor area.

Check the latest version details: Latest Post Shortcode 8.0

The shortcode settings are:

  • Number of Posts: how many to display if 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: what details to display about 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 to specify a number of chars for the options that require 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: select the post statuses you want to be exposed (this is dynamical, 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 here 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 link to posts, the tile patters 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 configure, like 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.

See the plugin in action

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

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

Support my work! Click the button below

See other plugins