Custom Function Repeating First Page Results
-
I am working on an upcoming events list for this site: https://catchfireuniversity.com
Since I need the events to only show if they are upcoming and need to sort the events by the event date (a custom meta field, not the date of the post) I am using my own custom args in my functions.php file.
I noticed in your documentation you state not to modify the “paged” or “offset” query parameters, so I haven’t set either of these.
However, the first page of results is repeating when I click the “Load More” button rather than getting the second page.
What am I doing wrong?
This is my shortcode:
[ajax_load_more id="upcomingevents" scroll="false" button_label="Load More"]
And this is my function:
function upcoming_events($args, $id){ $args = array( 'post_type' => 'event', 'meta_key' => 'event-date', 'meta_value' => date("U"), 'meta_compare' => '>', 'orderby' => 'event-date', 'order' => 'ASC', 'posts_per_page' => 3, ); return $args; } add_filter( 'alm_query_args_upcomingevents', 'upcoming_events');
Any help would be greatly appreciated.
The page I need help with: [log in to see the link]
- The topic ‘Custom Function Repeating First Page Results’ is closed to new replies.