Posted: December 19, 2016 at 12:58 pm
|
Hello, $arrParams = array( global $wp_query; $all_posts = array(); $postCount=0; If I were doing this with the WordPress query I would query like this: $arrParams = array( with the $pageId being returned on submit of the “load more” button to get the continuing data. Any ideas on how to get the equivalent of the ‘paged’ parameter in the Event Espresso query? |
I can suggest using a normal WP query. You can order the normal WP Query by adding a join on the esp_datetime table, then set the order on the posts_order filter. |
|
|
Do you have any code examples of what that might look like? |
https://gist.github.com/joshfeck/103efd299ce615188e978293a1254eeb |
|
|
Okay – I tried adding that code to my functions.php as well as the individual template without any luck on getting them to order correctly. I updated my query to use the WP query: am I supposed to set the ‘orderby’ parameter to something? Still not getting the events loading in order of start date… |
No you will not need to set the orderly parameter to something, but you may need to adjust the example code’s conditionals to make sure the filters run on your query. Also note that the above linked example code in of itself does nothing because the my_event_list_query_template_function() isn’t called or attached to an action. |
|
The support post ‘Load More Button Via Ajax and Custom Event Espresso Query’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.