Posted: May 9, 2018 at 1:02 am
|
Hi Support, We have using custom query to get event and try to write load more functionality but in attribute “paged” parameter is not working it gives same result as loaded on first page.
Please check above code and please provide help for create load more pagination code. (if possible please provide examples that would be more beneficial. ) |
Hi there, I’m afraid there is no pagination code in what you posted above. Here’s a link to a developer resource that show some examples of how to add pagination: https://developer.wordpress.org/reference/functions/paginate_links/#user-contributed-notes |
|
|
Hi Josh, Thanks for quick response. Please check below reference link. ( Just change $wp_query = new EE_Event_List_Query( $atts ); instead of your $wp_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery( $atts ); ) Ajax Load More my referred link: https://stackoverflow.com/questions/31587210/load-more-posts-ajax-button-in-wordpress As per above ajax reference link we need to pass data to “paged” parameter to get next post so I have try to implement this in your your code but it don’t work. can you please help me to implement load more ajax query? // ============ Load more ajax function ======== ====== $ppp = (isset($_POST["ppp"])) ? $_POST["ppp"] : 3; header("Content-Type: text/html"); $atts = array( $out = ''; if ($loop -> have_posts()) : while ($loop -> have_posts()) : $loop -> the_post(); endwhile; add_action('wp_ajax_nopriv_more_post_ajax', 'more_post_ajax'); // ===== ==== Ajax code in javascript file ===== ==== function load_posts(){ }); $("#more_posts").on("click",function(){ // When btn is pressed. If I used above all code with post or Custom post type then it will work fine but with Event Espresso I didn’t found why it is not working. Please help me to implement Load more functionality into Event Espresso. Thanks, |
Hi Pankaj, Event Espresso events are custom post types, so whatever you’re doing different with the custom post type query you already have working, you can apply the same code to a query for Event Espresso events. With regards to the sample code from the gist, I’ve updated it to include simple pagination. Sorry, no AJAX styled pagination included in the example, that’s really outside of the scope of support. I can recommend following this tutorial if you need to implement AJAX pagination: |
|
|
Hi Josh, I already tried with custom query but it is not working. So isn’t possible to add ” ‘paged’ => $page, ” or ‘offset’ => 3, in parameter? Thanks, |
It is possible to add |
|
The support post ‘Problem In Load More Event’ 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.