• Resolved smeyer012

    (@smeyer012)


    I am trying to show events in the same feed as blog posts and news posts (a custom post). Showing the feed is not the problem, but I am not sure how to address the dates. The event dates are saved as meta, not the publish date, so they appear in the feed (which is ordered by date) with the date the event was posted not the event date. Is there a way to save the publish date with the meta date or somehow evaluate the date amongst the other posts to display them in order?
    Thanks.

    https://www.ads-software.com/extend/plugins/all-in-one-event-calendar/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Richard

    (@richardgirling)

    Hi smeyer012,

    I will have to get someone from the dev team to answer this one. They are currently working on the new 1.8 version of the plugin, but please bear with us.

    Thread Starter smeyer012

    (@smeyer012)

    Can you tell me what the title of the start date metabox is? I am trying to write a filter function to save the start date as the post date, but I can’t seem to identify the meta name to use in get_post_meta.

    Thread Starter smeyer012

    (@smeyer012)

    So my original idea was to save the start date as the post date. In the past I’ve used the post date for this purpose and hacked my feeds to show future dates. The problem is that all of the built in calendar functionality works with published events only, so I’d have to do significant editing of the plugin to get it to show future events…this, I’ve decided, is a bad idea.

    So what I’ve decided to do is create a custom meta box for the blog and news posts with the same identifier as the start date meta box in events, and then order based on the meta instead of the post date.

    In order to do this, I need to know what the name of the start date meta…please help. I need this done by Monday.

    Thread Starter smeyer012

    (@smeyer012)

    As a very temporary fix in the interim, I am trying to just output the start date in the feed so that the date associated with the event is at least correct (instead of displaying the post date), despite not being in order.

    Even this I can’t seem to accomplish…

    To start, I looked at the single event template, which outputs the date with $event->timespan_html;
    So I tried just placing that in my feed function, with no luck. I realize that it might be a different context for $event, so I tried $post->timespan_html; …still nothing.

    I see in the database that the start date is saved under a key of “start.” Since you can use $post->post_ID I thought $post->start might work…nope. I also tried get_post_meta($post->ID, "start", true); with no luck.

    How can I output the start date? I looked through the post_meta table and I can’t find anything associated with it.

    Richard

    (@richardgirling)

    Hi smeyer012,

    I spoke with the dev team and they said this:

    “Event properties are not retrieved using get_post_meta(). They need to create the event object to retrieve things like start date, end date. Inside their loop they should have something like this:

    $event = new Ai1ec_Event( $post->ID );
    
      // Start time
      $start_time = $event->start_time; // Standard date
      $short_start_time = $event->short_start_time; // Short-form date
      $long_start_time = $event->long_start_time; // Long-form date
      // End time
      $end_time = $event->end_time; // Standard date
      $short_end_time = $event->short_end_time; // Short-form date
      $long_end_time = $event->long_end_time; // Long-form date
      // Convenient shortcut to output event's timespan
      $timespan_html = $event->timespan_html;
      // All-day event? (boolean)
      $allday = $event->allday;
      // Location (plain text, wrap this in a call to nl2br() to be HTML-formatted)
      $location = $event->location;
      // ... etc.

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    There are many more properties; review the Ai1ec_Event class declaration for more info (app/model/class-ai1ec-event.php)

    I hope that helps.

    I have the same exact problem as the original poster of this message. This was 6 months ago. Has this problem been addressed yet?

    All of my events have the posted date on my agenda feed. I guess this is due to my theme and the way it handles posts. Obviosly I don’t want the posted date of the event anywhere on my website because it’s irrelevent – I want the event date!

    I’m not familar with php but am pretty good with css, so what I’ve done in the interim is slap on a display=none which leaves me with a blank space. But then I tried yesterday to use the posting date the same as the event date manually in a kind of work-around. This didn’t work because you can’t view events posted in the future.

    The real fix would be to have the event date replace the posting date. Help?

    The above instruction is way over my head I have no idea what any of that means. I can replace code but the above is more than just replacing code.

    Thanks.

    my site:
    https://www.rubybridgespta.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: All-in-One Event Calendar] Events dates in a feed with other posts’ is closed to new replies.