Forum Replies Created
-
AuthorPosts
-
joeleadedesignParticipant
How uncanny. I just had the same question asked of me by a client. Great idea IMO. I’ll post an update if I find anything that may work.
Is there a UserVoice or suggestions form to vote for this feature?
November 8, 2015 at 3:45 pm in reply to: tribe_get_events orderby Post Date rather than Event Start Date #1023083joeleadedesignParticipantHa ha. That was a poor use of the code tag, sorry 🙂
November 8, 2015 at 3:44 pm in reply to: tribe_get_events orderby Post Date rather than Event Start Date #1023082joeleadedesignParticipantThanks Geoff. I’ve tried using WP_Query with
post_type=tribe-events
but it hasn’t helped. It’s still returning the posts in descending order by_EventStartDate
rather than thepost_date
.Here’s are my test use cases. The query is saved to CodePen – http://codepen.io/JoelEadeDesign/pen/KdGeWb. (FYI: I’m writing the date as Day-Month-Year to avoid any confusion, seeing as I’m in Australia and use a different date format than the US).
TEST 1
——
Event A has apost_date
of 09-Nov-2015 and an_EventStartDate
of 25-Nov-2015.
Event B has apost_date
of 05-Nov-2015 and an_EventStartDate
of 28-Nov-2015.
Event B is showing for my query but Event A should be appearing because thepost_date
is the highest/farthest into the future.TEST 2
——
Event A has an updatedpost_date
of 03-Nov-2015 and an_EventStartDate
of 25-Nov-2015.
Event B has apost_date
of 05-Nov-2015 and I’ve changed the_EventStartDate
to 21-Nov-2015.
Event A is showing for my query but Event B should be appearing because thepost_date
is now the highest/farthest into the future.Here’s the query returned when I vardump it to the page:
string(833) "SELECT SQL_CALC_FOUND_ROWS DISTINCT fsyth_posts.*, MIN(fsyth_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM fsyth_posts INNER JOIN fsyth_postmeta ON ( fsyth_posts.ID = fsyth_postmeta.post_id ) LEFT JOIN fsyth_postmeta as tribe_event_end_date ON ( fsyth_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND ( fsyth_postmeta.meta_key = '_EventStartDate' ) AND fsyth_posts.post_type = 'tribe_events' AND (fsyth_posts.post_status = 'publish' OR fsyth_posts.post_status = 'acf-disabled') AND (fsyth_postmeta.meta_value >= '2015-11-09 10:42:03' OR (fsyth_postmeta.meta_value <= '2015-11-09 10:42:03' AND tribe_event_end_date.meta_value >= '2015-11-09 10:42:03' )) GROUP BY fsyth_posts.ID ORDER BY EventStartDate DESC LIMIT 0, 1"
. That’s all a bit over my head…Let me know if you want me to do a video screencast or anything else that may help out.
Cheers,
Joel
joeleadedesignParticipantThanks Kelly. I’ll suggest it over on User Voice.
Cheers!
joeleadedesignParticipantHi Barry,
Completely understand re: limited support. What you’ve provided is great as it clarifies one of the options I was looking at. I wasn’t sure if the 2.x code could be applied to TEC 3.x, and thought it best to check before spending time using code that may be deprecated.
Cheers!
Joel
joeleadedesignParticipantThat’s awesome, thanks Kelly. I’ve sorted my tickets by ID and everything is working perfectly. Thanks!!!
One note – when copying the code from the tutorial (using Chrome on OSX) it also copied some extra info regarding the URL for the tutorial e.g. when I copied the first code snippet this is what appeared when pasted into Sublime Text:
function tribe_wootickets_custom_sort($p, $q) { if ($p->name name) return -1; if ($p->name > $q->name) return 1; return 0; } – See more at: https://theeventscalendar.com/knowledgebase/changing-the-order-of-tickets/
Nothing I couldn’t fix by deleting the extra code but it might catch out some people.
Cheers!
- This reply was modified 9 years, 1 month ago by Leah.
joeleadedesignParticipantShall do, Barry. Apologies for my unhelpful post.
Seems it may have already been found on this thread – https://theeventscalendar.com/support/forums/topic/the-events-calendar-update-affects-site-heading-on-every-page-of-website/#post-60971
joeleadedesignParticipantSame for me
August 8, 2013 at 2:01 pm in reply to: Debug mode always on and Monthly Calendar AJAX pager even though AJAX off #59553joeleadedesignParticipantThanks Barry!
My reasons for turning it off are unique which is why I didn’t explain my motivation. I’m using Advanced Custom Fields to add inline style background color/images to the calendar td’s. When ajax is enabled, navigating between months seems to conflict with a script I have that sets the height of the background image. I’m terrible at explaining so have a look at http://joelea.de/brightspace/exhibitions/ and you’ll see what I mean.
Go to September and you can see that there are events however the background image doesn’t appear. It’s in the DOM. A page refresh seems to be required in order to fire the js I have that sets the background image height.
Cheers!
Joel
August 8, 2013 at 4:33 am in reply to: Debug mode always on and Monthly Calendar AJAX pager even though AJAX off #59460joeleadedesignParticipantKudos to the great Chip Bennett – http://wordpress.stackexchange.com/questions/43060/deregister-multiple-scripts-using-a-function
August 8, 2013 at 4:30 am in reply to: Debug mode always on and Monthly Calendar AJAX pager even though AJAX off #59459joeleadedesignParticipantAha! I found a function to deregister the ajax for the calendar:
add_action( ‘wp_enqueue_scripts’, ‘my_deregister_javascript’, 100 );
function my_deregister_javascript() {
wp_deregister_script(‘tribe-events-calendar’);
}August 8, 2013 at 4:18 am in reply to: Debug mode always on and Monthly Calendar AJAX pager even though AJAX off #59457joeleadedesignParticipantTo assist in making the description perhaps list the functions that utilise ajax i.e. Enable ajax to live refresh the Search/Find Events and the Date Picker.
Cheers!
August 8, 2013 at 4:14 am in reply to: Debug mode always on and Monthly Calendar AJAX pager even though AJAX off #59456joeleadedesignParticipantHi Barry,
I interpreted the “Enable ajax to live refresh content.” to relate to any ajax activity, so for me it is confusing to have it unchecked but still have the calendar refresh using ajax when navigating between months below the calendar.
I’m hoping to disable ajax all together. Is that possible?
Thanks,
Joel
joeleadedesignParticipantHi Jonah,
Apologies for the poor video quality. It was my first recorded Gogole+ Hangout 🙂
I’ve posted snippets with The Event Calendar “table.php” and custom jQuery here –
table.php: http://snippi.com/s/ehua0uq
jQuery: http://snippi.com/s/ooj4w6yMy friend, Ben Pearson, helped with the jQuery and has made a Codepen post here – http://codepen.io/benpearson/pen/mazry
Have a great day,
Joel
joeleadedesignParticipantHi Jonah,
My sincere apologies for wasting your time. I’m not sure what I’d done wrong but I now have it working. I think I may have assigned the ACF field to the wrong post type, as I’m now able to set a background color and/or background image, as well as having text field values appear.
Thanks for your advice on where to add the style css. It worked a treat! I now have to put my jQuery hat on and set the height of the event in the td based on the number of events on that day i.e. two events, height = 50%, three events, height = 33%. Here’s a pic of what I’m trying to achieve – http://imgur.com/rusOuJE. Wish me luck!
Cheers,
Joel
-
AuthorPosts