Forum Replies Created
-
AuthorPosts
-
Barry
MemberHmm, well that’s puzzling (re auto updates for WP) but thanks for confirming it isn’t connected with The Events Calendar.
I’m glad you got things updated, though, and will go ahead and close this thread π
Barry
MemberHi Jonathan,
Right now we’re still considering different options and have (since your last post) been progressing other areas of the plugin – so I’m afraid I’ve got nothing further to share at this time with regards to 404s or handling of soft 404s in particular.
Thanks π
Barry
MemberOK, so in case there is a conflict with either a physical directory or another page/post, can you visit the Events β SettingsΒ β General admin screen and adjust the events URL slug setting to something like calendar … does that resolve this?
Barry
MemberThank you for testing it and reporting back. So just as a bit of background detail there it looks like if there are multiple instances of a recurring event marker data for all of them is sent to the browser. Depending on their exact order, we could end up with a scenario like you described (and my snippet simply removes all recurring instance markers but the earliest for each event).
In any case, glad that works for you and I’ll get this logged as something we need to address.
May 19, 2014 at 6:30 am in reply to: How to show Previous Events if there are no Upcoming Events #165941Barry
MemberApologies, I forgot you don’t actually get a WP_Query object back when you use tribe_get_events(). Even so, you should receive an array as the result – so perhaps you could do something like:
$events = tribe_get_events( $your_original_query ); // Check if any events were returned if ( count( $events ) > 0 ) { // Your code to display the results } else { $events = tribe_get_events( $your_past_event_query ); // Display past events instead... }Does that help?
Barry
MemberHmm, even with that same HTML in an event appearing on the first page of results I’m afraid I cannot replicate the problem … definitely a strange situation but, honestly, right now I’m not sure there is much more we can do to help.
I did take another peek at your site but it looks like perhaps you’ve now removed the pagination links completely?
Barry
MemberThat’s correct – there are no recurring events facilities in the core plugin (The Events Calendar itself).
Barry
MemberHi Heather!
You can set up as many tickets per event as you like – so you could indeed (in your example) offer for sale a set of options like you’ve outlined π
Thanks for contacting us (if we guide you on anything else please just let us know – but it would be great if you could post a fresh thread of your own).
Cheers!
Barry
MemberInteresting: just to be sure I’m not missing anything could I ask you to post the code as is via Pastebin or Gist (sometimes the forum automatically converts HTML entities and strips other elements out). That would be supremely helpful π
Barry
MemberAwesome, thanks for confirming and I’m glad that all worked out π
I’ll go ahead and close this thread (and we’ll get that tutorial updated). Last but by no means least, if you happened to have a moment and wished to post a review of The Events Calendar we’d love to hear your thoughts. Thanks again!
Barry
MemberIt’s not impossible it relates to the nature of the event data … it definitely sounds like a very specific problem though rather than a general one. Are you able to duplicate this (complete with pages, posts etc) somewhere other than the live environment?
Barry
MemberIf you’re game, can we try an experiment? Could you add the following to your theme’s functions.php file?
add_filter( 'tribe_events_ajax_response', 'adjust_map_markers' ); function adjust_map_markers( $response_data ) { if ( ! isset( $response_data['markers'] ) ) return $response_data; $regular = array(); $recurring = array(); $final_date_segment = '#(\\d{4}-\\d{2}-\\d{2})/$#'; // Look at the existing markers and separate those for regular events and recurring events // into two separate buckets foreach ( $response_data['markers'] as $marker ) { $parts = array(); preg_match( $final_date_segment, $marker['link'], $parts ); // Doesn't look like a recurring event? Add to the regular markers array if ( ! is_array( $parts ) || count( $parts ) !== 2 ) { $regular[] = $marker; } // If it *does* look like a recurring event store separately (keep the earliest version) else { $marker['recurrence'] = strtotime( $parts[1] ); // Date of recurrence $identifier = $marker['venue_id'] . $marker['title']; // Overwrite an existing entry only if the date of the current entry is earlier if ( isset( $recurring[$identifier] ) && $marker['recurrence'] < $recurring[$identifier]['recurrence'] ) $recurring[$identifier] = $marker; // If it hasn't been added already, add it elseif ( ! isset( $recurring[$identifier] ) ) $recurring[$identifier] = $marker; } } // Re-combine regular and recurring event markers $response_data['markers'] = array_values( array_merge( $regular, $recurring ) ); return $response_data ; }I think I see what the problem is and if that snippet resolves this for you (it may not, of course) that will be a good piece of confirmation and we can get this slated for a substantive fix in a future release.
Let me know how you get on!
Barry
MemberI do apologize, you’re absolutely right – events are ordered according to event date (which is by design). Possibly though, for feeds only, you could avoid this with a further snippet:
add_action( 'pre_get_posts', 'maybe_teardown_tribe_order_filter', 60 ); function maybe_teardown_tribe_order_filter() { if ( is_feed() ) remove_filter( 'posts_orderby', array( 'TribeEventsQuery', 'posts_orderby' ), 10, 2 ); }Does that help?
Barry
MemberHi lisamkarl – Janet’s answer might give you what you need there but if not please do create a new thread of your own and one of the team will help you as soon as they can π
I like the pagination by default but having a βview allβ option on list view would be a great addition. Can you add that to your list of enhancements for future releases?
Ahh, ok. We more than welcome feature requests like this if you’d like to post one (or, if you notice a suitable existing request, you can add your support to it by commenting/upvoting it) π
One worry about implementing it as a general feature is it could cause issues for sites with a much larger number of upcoming events than perhaps you have (a huge result set might “crash” some sites) though I guess it could potentially function as an additional view that is disabled by default. At any rate, certainly do post a request and one of the team will review in due course.
Thanks again!
Barry
MemberExcellent, that’s probably the best path here then π
I’ll go ahead and close this thread but as always if we can assist with anything else please don’t hesitate to create new threads as needed.
-
AuthorPosts
