• Resolved Colin

    (@phazerave)


    I am using a plugin called “the event calendar” a very commonly used event calendar.

    The following code will ONLY display events for which the “_EventStartDate” field is set to the future… I can not for the life of me understand why. I have been all over the database to confirm that the plugin’s custom post types are handled in the same way as every other custom post type. They dont change the post type slug or anything when an event is set to the past, None of the events fields (including hidden fields) do not indicate a past event is a past event other than the _eventStartDate field. and yet once I set the start and end dates to be in the past, the event stops being included in the loop, and will pop back in as soon as I change the start date to be in the future. Ive been using your plugin religiously for a long time and I dont even see how a custom post type’s custom field could even be taken into effect using this particular loop. Its boggling my mind. Please help, thanks!
    here’s the ridiculously straight forward code ??

    [loop type=tribe_events]
    [field title]
    [content]
    [/loop]

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Colin

    (@phazerave)

    So I got a response back from the developer of The Event Calendar Plugin:

    We filter basic queries of the “tribe_events” post type to have additional controls over the content pulled. If you’re able to with the shortcodes you’re describing, try adding a query argument for the loop to have “eventDisplay” be “custom”.

    I looked through the reference guide but didnt see anything that could pass query strings like this. perhaps I wasnt looking hard enough. can you help?

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, in the latest plugin update (3.4.8), I added a way to add this to the query: [loop type=tribe_events eventDisplay=custom]

    I haven’t tested it yet, so please see if it works. ??

    Thread Starter Colin

    (@phazerave)

    Wow thanks for doing that! sadly though it still shows only the future events. I wish I could be of more help here, but let me know if you need anything else

    just to add in case there is something here you see that’s off. this is my current code:

    <div class="meeting-data-flex">
      [loop type=tribe_events eventDisplay=custom orderby=_EventStartDate order=DESC]
        <div class="meeting-data">
          <h2 class="nostyle">[field title] - [field _EventStartDate date_format="F j, Y, g:i A"]</h2>
        [content]
        </div>
      [/loop]
    </div>

    And the page exists here , at the top you will see a link for upcoming meeting documents which expands to reveal the above code. currently there is a single future meeting, and by using the bottom calendar you can see there are two past meetings which dont show up in the loop up top. Let me know if you need something else.

    Thread Starter Colin

    (@phazerave)

    Since my ultimate goal is actually to have a second dropdown that says “previous meeting’s documents” which only shows the last meeting instead of showing all meetings in one area, I thought this might help.
    I noticed that on the tribe events page, the url query to display past events is ?tribe_event_display=past Does that help in any way?

    Plugin Author Eliot Akira

    (@miyarakira)

    I looked at their documentation, and it looks like they have a function called get_tribe_events which performs queries specific to their event data type. I suppose they don’t have a shortcode for it?

    I’ll set up a test case with The Events Calendar plugin, to see how to display past events.

    Thread Starter Colin

    (@phazerave)

    Yeah they dont have a shortcode strangely. there is a 3rd party shortcode plugin for it called “The Events Calendar Shortcode” however for my purposes here I need to display the main post content of the event, and it will not do that. Thank you so much for helping I really appreciate it!

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, please try the newest plugin update (3.5.2), with display=custom. Apparently, eventDisplay with its capitalized D was not getting through, so I simplified the parameter name. This should set eventDisplay to custom in the arguments to WP_Query.

    If that doesn’t work, it may be necessary to use get_tribe_events directly.

    Thread Starter Colin

    (@phazerave)

    YES! It works! Thank you SO much for doing all of that, by FAR the best service I have received on any plugin, also, no exaggeration, your plugin is pretty much the best one out there hands down. I use it on every site I make, when mixed with custom post types and fields, it is pretty much unstoppable. I think Ill go make a donation.

    Thread Starter Colin

    (@phazerave)

    display=custom is all events
    display=past is all past events
    display=list (default) is all future events

    Plugin Author Eliot Akira

    (@miyarakira)

    I’m glad to hear that it worked. Oh, I see, you can pass different parameters to the events calendar too – that’s pretty neat. ?? I’ll make a note in the documentation. Thank you for the kind words and donation.

    I needed EXACTLY the same thing! THANK YOU.

    Perfect! sorted out what I needed to do listing the next three upcoming events, I hadn’t noticed it was sorting by the post date.

    My code (has a div for the grid were using) just incase any use. Shows the next three events in upcoming order with the event manager dates.

    [loop type=tribe_events count=3 image=featured_image clean=true eventDisplay=custom orderby=_EventStartDate]
    <div class="col-lg-4">[block class=course-teaser]
    [field image-link]
    [h4][field title-link][/h4]
    [field _EventStartDate date_format="F j Y"]
    [p][field excerpt][/p]
    [/block]</div>
    [/loop]
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘*strange* will not show past events via "The Event Calendar"’ is closed to new replies.