• soorajmalhi

    (@soorajmalhi)


    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Bet Hannon

    (@bethannon1)

    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?

    Thread Starter soorajmalhi

    (@soorajmalhi)

    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.?

    Moderator Bet Hannon

    (@bethannon1)

    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?

    Thread Starter soorajmalhi

    (@soorajmalhi)

    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

    Moderator keesiemeijer

    (@keesiemeijer)

    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-archives

    Not what you wanted to hear, but look at the plugin code to see how it manages to add the post types to the calendar.

    Thread Starter soorajmalhi

    (@soorajmalhi)

    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.

    Moderator keesiemeijer

    (@keesiemeijer)

    Where does the event date come from? Custom fields?

    Thread Starter soorajmalhi

    (@soorajmalhi)

    Yes event date come from custom field date

    Moderator keesiemeijer

    (@keesiemeijer)

    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-28

    If 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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WordPress event calendar’ is closed to new replies.