Get event list with feature image

Plugin: The Events Calendar By Modern Tribe, Inc.

The event data is stored on multiple rows in two tables: wp_posts and wp_postmeta.

SELECT `post_title`,`post_content`,post_name,
(SELECT meta_value FROM `wp_postmeta` WHERE post_id=p.id and meta_key=’_EventStartDate’) Start,
(SELECT meta_value End FROM `wp_postmeta` WHERE post_id=p.id and meta_key=’_EventEndDate’) End,
(select p1.guid from wp_posts p1 join
(select po.id,m.meta_value from wp_posts po join wp_postmeta m on po.id=m.post_id and meta_key=’_thumbnail_id’ where post_status=’publish’) m on p1.id=m.meta_value where m.id=p.id) featureimage
FROM `wp_posts` p WHERE post_type=’tribe_events’ and post_status=’publish’

event list

event List Feature Images

Reference project: https://vincentkempp.com

Leave a Reply

Your email address will not be published. Required fields are marked *