i had to do it, i was looking for something very simple : just add a date event to some post to show it in archive of my news (it can be a start date and a end date also).
You need to add custom field to posts by adding a metabox to post screen, easyly with ACF plugin, or by yourself coding it in your theme's functions.php or in a self made plugin...
For example _my_evt_date, you will find it in postmeta table as meta_key with a meta_value like 2020-12-24 string.
The idea is to make a query in this table to store in an array each post having such meta key, you can create a json multiple array with post_id, date, html to display ...
In the archive page showing your news posts thumbnails, look at html code of each article in the loop, you'll probably have a css class including the post id, maybe like "post-entry-3217", "post-entry-3218"....
- call my database query with jQuery.get to load in a js array my php array with dates information
- parse article blocks matching css class post-entry-xxxx,
- extract the post id xxxx
- create a loop and parse the js array till matching the related post_id
- insert with jQuery.append some html with date information above the related thumbnail
// only in the archive page
if( jQuery('.slide-entry').length )
// Load in an array results
ckc_yaevt = jQuery.parseJSON(data);
// Extract xxxx from each slide-entry-xxxx
var post_id = jQuery(this).attr('class').match(/\d+/);
// Parse array with posts having dates
for (var i=0; i<ckc_yaevt.length; i++)
if ( ckc_yaevt[i] === post_id && ckc_yaevt[i] !== '' )
// Add html in the loop