WordPress event calendar
-
Can you be a little more specific about what the needs are? What is it that the client is looking to have the calendar do that WordPress Event Calendar won’t do?
Client only wants to have a event calendar which fetches the event data from custom post type, but the restriction is, client doesn’t want to use any event calendar plugins.
Can we use wordpress calendar widget to show the events.?I believe that the WordPress calendar widget is set up to only show when posts are published. You would have to do an awful lot of custom coding to make the default calendar widget show the events from custom post types– it might show the publication dates, but you will be wanting to show the event date instead.
I have done a couple of sites where we created custom post types for events, and then displayed the metadata for those events (a permalink with the event title, the date, etc.) in a bulleted list. That’s more straightforward, although it does involve some PHP-work to set up the template.
Would something like that work? – Or is the client wanting to have these events displayed on a calendar grid?
Thanks for you kind response, Actually client want to have calendar grid to show the events with permalink, any source of guidance will be helpfull
Without using plugins you’ll need to code the calender (grid) yourself.
Can we use wordpress calendar widget to show the events.?
No, but there are plugins that add the post type to the widget.
https://pippinsplugins.com/custom-post-type-calendar-widget/
https://github.com/keesiemeijer/custom-post-type-date-archivesNot what you wanted to hear, but look at the plugin code to see how it manages to add the post types to the calendar.
Thanks keesiemeijer, I had already used custom post type calendar widget but it showed custom posts based on publish date, do you know how we can show the custom posts based on event date.
Where does the event date come from? Custom fields?
Yes event date come from custom field date
I don’t think there is a plugin for that. The easier option would be to use a calendar plugin.
Here’s how you could do it yourself:
Create your own widget (plugin) for the custom field calendar.
https://codex.wordpress.org/Widgets_API
http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28If you look at the default calendar widget it uses the the function get_calendar() to display the calendar
https://developer.wordpress.org/reference/functions/get_calendar/Copy the function and rename it in your widget. Change the queries to use your custom field to get the events posts.
Here is a plugin that will let you query for events that have a start date custom field and an end date custom fields (spanning multiple days).
https://github.com/keesiemeijer/meta-date-archive
- The topic ‘WordPress event calendar’ is closed to new replies.
(@soorajmalhi)
9 years ago
Hi all, I need to create event calendar for my custom post type, so is there any one who can guide me how to do that, as per requirement of the client I can not use the event calendar plugin.