Skip to the content.

Shortcode Item Updated

Simple & lightweight: Flexible Shortcode for showing the last updated date (and/or time) of an item of a post type.

Tested Compatibility


Support the Project

If you find this project helpful, consider showing your support by buying me a coffee! Your contribution helps me keep developing and improving this plugin.

Enjoying the plugin? Feel free to treat me to a cup of coffee ☕🙂 through the following options:


Description

Very useful to output the updated date of a custom post type item on a regular page, within a widget or anywhere else… :-)

Backstory: I needed something like that for a client project to display the last updated date/time of a download post type on a regular content page. Since I knew, I would need the same functionality for an other existing site and maybe in future too, I just build it into a “general plugin” rather than a simple code snippet…! There were no existing plugins/solutions out there (at least I didn’t found them yet…) that fitted my needs so I had to build it myself…


Features


Installation

Quick Install

  1. Download ZIP: shortcode-item-updated.zip
  2. Upload via WordPress Plugins > Add New > Upload Plugin
  3. Once activated, you can use the shortcode – see Usage below

Usage - Examples

Example - default:

[siu-item-updated]

Will show only date (as set in WordPress Settings > General) for the current displayed post (ID pulled via get_the_ID()) - has to be used within the Loop in this default state.

Example - custom 1:

[siu-item-updated post_id="363"]

Will show only date (as set in WordPress Settings > General) for the item of a post type with post ID “363”

Example - custom 2:

[siu-item-updated post_id="363" show_time="yes" show_sep="yes"]

Shortcode Parameters

Parameter Description Default Translateable
post_id ID of the post of any (public) post type get_the_ID() = ID of the current displayed post – in this case, Shortcode has to be used within the Loop!)
date_format PHP date format setting as in WordPress Settings > General (automatically via date_i18n() )
time_format PHP time format setting as in WordPress Settings > General (automatically via date_i18n() )
show_date will display updated date, by default visible! yes
show_time yes will display time also no
show_sep yes will display separator string no
sep optional separator string  @ (that is a space plus @-symbol, like so: “ @”) yes!
show_label yes will display a label string before date & time values no
label_before label string before date & time values Last updated: (by default not shown) yes!
label_after label string after time value – useful for languages like German to get time values like “9.40 Uhr” (see the “Uhr” string) ”” (not displayed)
class additional custom class for the wrapper ”” (none)
wrapper HTML wrapper element - any HTML5 wrapper is possible span

Shortcode Parameters - Bonus Shortcuts


Widget Usage

NO LONGER recommended! Widgets are outdated, I do not recommend them (and didn’t use them myself for lots of years already!).


Template Usage (Developers)


Plugin Filters (Developers)


Changelog – Version History

v2.0.0 (March 2025)

Version 2016-08-19

Version 2016-08-12

Version 2015-05-26

Version 2015-05-25


Copyright © 2015-2025 David Decker – DECKERWEB.de