WordPress.org

Ready to get started?Download WordPress

Forums

WP FullCalendar
Use custom fields as dates (10 posts)

  1. laurienicholas
    Member
    Posted 1 year ago #

    Hi Marcus/Community,
    I have a custom post type that has dates stored in custom fields.
    Is there anyway I could plot the dates on the calendar using the values from the custom fields rather than the post publish date?
    Thanks,
    Laurie

    http://wordpress.org/extend/plugins/wp-fullcalendar/

  2. Shaun Brown
    Member
    Posted 1 year ago #

    I too would greatly appreciate this functionality! This would be a crucial feature if its possible.

  3. angsty
    Member
    Posted 1 year ago #

    I am also trying to figure this one out. I'd like to display the custom posts according to the date in my metabox/date picker, rather than the post creation dates. I'd appreciate any ideas on how to accomplish this.

    Thanks

  4. angsty
    Member
    Posted 1 year ago #

    I was able to figure out a solution. It probably isn't very elegant, but it worked.

    There's a variable called $post_timestamp that appears in the section that starts at line #179. I just set it to reflect the content of my custom field and the posts showed up on those dates.

  5. sunriseweb
    Member
    Posted 1 year ago #

    I'm looking at how the Events Manager plugin overrides the calls for event data to see if I can do something similar. May just end up using the Events Manager plugin even though it is overkill for what I need.

    In the wp-fullcalendar.php the code checks to see if the Events Manager plugin is installed:

    //START Events Manager Integration
    		if( defined('EM_VERSION') ){
    		    include('wpfc-events-manager.php');
    		    wpfc_em_init();
    		}
    		//END Events Manager Integration

    In the wpfc_em_init() function it removes the actions that get the event posts and use the post publish date to build the json, and adds in it's own that build the json using the Event Manager specific info:

    remove_action('wp_ajax_WP_FullCalendar', array('WP_FullCalendar','ajax'));
    		remove_action('wp_ajax_nopriv_WP_FullCalendar', array('WP_FullCalendar','ajax'));
    		add_action('wp_ajax_WP_FullCalendar', 'wpfc_em_ajax');
    		add_action('wp_ajax_nopriv_WP_FullCalendar', 'wpfc_em_ajax');

    So I'm thinking that maybe I'll create my own function that is the equivalent of wpfc_em_ajax and add it in the same way. The problem is that I think I'll have to hack the core code of wp-fullcalendar.php so that it recognizes my function - may try it without that first.

  6. hughes1974
    Member
    Posted 1 year ago #

    anyone get this to work?

  7. sunriseweb
    Member
    Posted 1 year ago #

    I ended up using the Events Manager plugin and the custom post type that comes with it to treat events separately from blog posts. Sorry - not much help. The site turned out well though I think - http://harmonyhousetheatre.com .

  8. hughes1974
    Member
    Posted 1 year ago #

    Thank you, the issue i have is my event post type has several custom fields that i need to display. I just need to figure out a way to have the time change based on the custom field.

    thank you for the advise, site looks great.

  9. wpsupprt
    Member
    Posted 1 year ago #

    An other way will be to allow FUTURE custom post type to be displayed on the calendar.
    This way you can use the WP Publish Date and Time, no need of custom field.
    This post helped me achieving this
    http://wordpress.stackexchange.com/questions/44202/how-to-set-a-custom-post-type-to-have-viewable-future-posts

  10. hughes1974
    Member
    Posted 1 year ago #

    This is great, but what about the expiration date? the event ends on this date... when expired the post deletes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic