Latest Post Shortcode 9.0
The features introduced in version 9.0 include the support for attachments as tiles, and date filters. The “Latest Post Shortcode” helps you display a custom selection of articles as a list, as a grid, or even as a responsive slider (posts, pages, your custom post types, attachments) in a page/sidebar, without having to code or know PHP.
Summary
- NEW Support for attachments as tiles
- NEW Date filters
- The plugin has been tested up to WordPress 5.1.1
- Added the tile image alt attribute
- Fixed the
as-overlay
tiles without links
Support for Attachments as Tiles/Cards
This enhancement allows you to configure and expose the media images (attachment
post type) as tiles.
If you use any advanced media library that handles image categories and tags as standard taxonomies, taxonomies terms, and post taxonomies terms relationships, you would be able to filter the images by categories and tags like any other post type.
Show Mime Type
There are two new extra options for the tiles when using the attachment post type:
- Show mime type: this will output after the title “Mime Type: type” text
- Show mime type as CSS class: this will add the mime type CSS class to the tile wrapper element (for example, if the attachment mime type is
image/png
, the classes would beitem-mime-type mime-png mime-image-png
)
As a note, please make sure you select the inherit
status for images if you need to expose only attachments with the shortcode, as this is the native default status for this post type, instead of published.
Date Filters
This is a new feature that allows you to filter the published posts by date. There are two types of date limits:
The range of dates
This option allows you to filter the selection by setting the after date, the before date, or both of these.
The dynamic range
You will be able to specify a dynamic range of dates, calculated based on how many months, weeks, days, or hours ago the items were published.
See below an example:
[latest-selected-content limit="4" display="title,date,content-small" titletag="h3" chrlimit="120" date_after="2019-03-10" date_before="2019-03-23" image="medium" elements="1" css="two-columns tall as-overlay light" type="attachment" status="inherit" orderby="dateD" show_extra="show_mime,taxpos_show_mime_after-date,show_mime_class"]
For styling purposes, I added to this example some minimal CSS, to make it look different, but you can style it as you need. My example style is:
.latest-post-selection article .item-mime-type {
background: rgba(255,255,255,0.7);
color: #000;
display: block;
font-size: 10px;
padding: 0 5px;
position: relative;
text-align: right;
}
If you would like to support my work, consider making a donation, buy me a coffee, leave a 5 stars rating, or share this on your feed.
A huge thanks in advance!
You can download the free plugin from the WordPress repository.