Using Events Calendar posts outside the plugin

Home Forums Calendar Products Events Calendar PRO Using Events Calendar posts outside the plugin

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1147766
    Susan
    Participant

    I use the Custom Content Shortcode WP plugin to build custom query loops within page content, and I’ve used it to build event feeds because there’s much more flexibility than the Event Calendar shortcode. The feed on this page is an example. The loops can filter by post type, taxonomie(s), and field values (including date fields).

    I want to build loops which call a specific date range, but only future events will display. I think it’s probably because the default for tribe_get_events is ‘future’, although I don’t understand how that applies outside the Events Calendar plugin. This is a college, so there are a lot of events I need to display by semester or school year, and the whole list needs to stay up throughout. Here’s the test loop I’m using, it finds events with the event category ‘academic-calendar’ in the specified date range and displays the title and start date. Everything works properly except past events don’t display:

    [loop type=tribe_events taxonomy=tribe_events_cat term=academic-calendar field=_EventStartDate field_compare=more value=’2016-09-01 00:00:00′ field_2=_EventEndDate field_compare_2=less value_2=’2017-01-30 00:00:00′]
    [field title]; [field _EventStartDate]
    [/loop]

    I need to find a way to bypass the future event default. A way to specify the post type? A taxonomy? A php snippet which will override the future default in the Custom Content loop? I’m sure that if I override the future default globally the result will be chaos! I can wrap the loop in a div with a specific id to target, but I can’t add an id inside the loop.

    Separate question: At one point I found a file in the plugin files which included lists of all the fields in events, venues, and organizers, maybe to set the default values. That’s how I figured out ‘_EventStartDate’. Now I can’t find it!!! What is it?

    Thanks, Susan

    • This topic was modified 9 years, 8 months ago by Susan. Reason: forgot to add hyperlinks
    #1147908
    Josh
    Participant

    Hey Susan,

    Thanks for reaching out to us!

    I’m not sure how to manage what you’re trying to do with the Custom Content Shortcode. However, I can try to get you pointed in the right direction on how you would do this with our functions (a basic wrapper for WP_Query).

    For example, take a look at our tutorial on using tribe_get_events() and toward the bottom the section on “GET ALL EVENTS IN A SPECIFIC TIME RANGE”

    I’m not sure how the Custom Content Shortcode creates the queries, but it does look like it could be a pass through for a WP_Query. If so, you could try adding those arguments in that snippet to your shortcode as arguments similar to the others to see if that will work there.

    For the meta, you can find a list like that within the core Events Calendar plugin under the src > Tribe > Main.php starting at the “public $metaTags” line.

    Let me know if this helps.

    Thanks!

    #1148311
    Susan
    Participant

    After a bunch of searches I discovered that somebody else had the same issue and the developer of the Custom Content Plugin implemented a solution: . If you can add this to your references in case you get another inquiry, you’ll make somebody’s day.

    Thanks for the “public $metaTags” reference.

    #1148924
    Josh
    Participant

    Hey Susan,

    Awesome! I’m glad you were able to find a solution here. Do you happen to have a link to the solution?

    Thanks!

    #1149035
    Susan
    Participant

    The link to the solution is https://wordpress.org/support/topic/strange-will-not-show-past-events-via-the-event-calendar. Looks like I forgot to insert it in the previous post.

    #1149381
    Josh
    Participant

    Hey Susan,

    Awesome! Thanks for following up with that. Looks like it does work the way we thought it could with a minor modification to the syntax. Good to know!

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Using Events Calendar posts outside the plugin’ is closed to new replies.