You could get your get_publications functions to return a JSON object with all sorts of information you need.
e.g
function get_publications() {
// Your query here.
$data = [
'html' => $your_html,
'found_posts' => $query->found_posts,
'current_post' => $query->current_post,
'current_page' => $page,
etc...
];
echo json_encode($data);
}
And then parse that data with your javascript.
Related Posts:
- Debug whats going on inside a function called from AJAX
- Getting the URL of the parent page
- Custom post type – use ajax to display sub pages
- Load Next Posts With AJAX not working with custom post type
- WordPress notification if new post published
- Display custom-post type based on the Title matching the current selected value
- How to submit the date with ajax?
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Collect custom post in a calendar
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- limit selection of custom taxonomies to one?
- Updating custom post meta with ajax
- Favouriting a Custom Post Type
- WordPress post sorting with AJAX
- Prevent reload confirmation after AJAX save
- jQuery UI in Admin (Best Practice?)
- is_singular() not working if called via callback function of admin-ajax.php
- How to filter post data with AJAX on page?
- Getting a div content of a post in wordpress?
- Is there an easy way to AJAX-ify saving of post?
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- How to save the checked boxes?
- How to use wp_mail in CPT page
- Timepicker-addon doesn’t show – Datepicker works fine?
- Query Custom Post Types & category_name?
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- Ajax form filter post by custom fields [closed]
- How to load custom post archives sub-pages with ajax?
- different template for first and second level custom post page
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Ajax Check Post Status
- Received nothing after executing AJAX post function
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Loading custom content type from ajax results?
- Ajax Custom Post Filter is not filtering
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Load Custom_post_type categories post with ajax
- Dynamic Custom Fields
- $post not working working in AJAX plugin with custom post type
- Load Next WordPress Posts With AJAX?
- Dynamically output a class to an anchor tag depending on what tag is chosen
- Why won’t this jQuery code work?
- Custom post type’s extra fields – how to handle?
- Custom Post Type Slick Slider “$ is not a function”
- admin-ajax.php GET custom-post titles
- Post will not load via ajax
- ajax response not recieving
- Getting a GET error in console – 404 not found for wp-json
- filter by custom taxonomy using ajax
- How to Query in WordPress which shows Alphabetic Posts?
- Revert to previous dropdown options after change
- Creating a Tabbed Widget
- Multiple wp_editor instances in custom post type using Ajax
- How can I implement jQuery plugin correctly with my CPT?
- Masonry Append WordPress posts with singleMode
- Displaying information from custom field on custom post type
- I can’t connect my custom jquery to wp admin
- jQuery UI & Admin (Calendar)
- WordPress custom post type numeric pagination with ajax
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- WP_Insert_Post creating duplicate posts when logged in
- Not saving custom taxonomy while using ajax
- Search for custom field input of a custom post type in ajax live search
- Filtering posts based on three taxonomies
- Trying to list years (for a filter) but not all years display
- Disable button after one click per user per post
- How to display custom post type pagination buttons when processing AJAX request
- how to display new private message to users?
- Show ajax form resuslts in page
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- load wordpress events into full calendar jquery
- Is there a best practice, or typical way to do AJAX updating for data on a custom admin screen or post.php?
- CPT not entering jQuery ready state
- Filterable portfolio in WordPress using jQuery isotope
- Fetch loop of custom post types with AJAX
- Calling in Post Content via AJAX
- jQuery tab_title already in use
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Toggle a metabox based on a selection
- Updating custom post meta with ajax
- Custom filtering on month value only of an entire date field
- Two different archive pages showing the same content
- update custom taxonomy with Ajax in edit.php file [duplicate]
- Add a class to a menu item depending on a body class
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- How to filter custom post data with AJAX?
- Internal Server Error when echoing an OBJECT from wp ajax action function in functions.php to JS file
- Appointment booking system in WordPress
- Hide load more button if no more post in selected category
- Passing total post count to javascript
- Pull total post count for child category and parent if term ID
- Default post showing more than intended
- Load more post with AJAX
- Get current post type within functions.php
- Search and filter terms of a custom post type only and display results
- Post current post type to my Ajax