List Event Post Type – WordPress Widget Plugin

By | March 4, 2013

This is a widget that lists posts in the custom post type “events” and sorts them by custom meta field “event_date”.

Use your custom HTML markup to display the list. These codes can be used:
[title] < – title of event post
[link] <- permalink to event post
[venue] <- custom meta field “event_venue
[date xxx] <- custom meta field “event_date” in the PHP date format “xxx”

for example:

<p class="date">[date Y-m-d]</p>
<p class="info"><a href="[link]">[venue] - [title]</a></p>

Use other plugins, such as “Advanced Custom Fields” or code you theme to include the custom post type “events” and meta fields “event_date” and “event_venue”, without these the widget will not work as expected.

This plugin is not finished, many things can be improved, it doesn’t for example check if a post has the field “event_date”, or has a custom post type “events” at all. Default values would have been nice too.. But it works ok for now.

Download the plugin file

Leave a Reply

Your email address will not be published.