How do I get_the_postID() for a custom post that uses ACF repeater field?

From the plugin code I can see that it uses query_posts() to set up a new context for your template if you’re using display=”blah.php”. So you should just need to add the loop around your template: <?php /** * Template Name: Gallery */ while ( have_posts() ): the_post(); // <– Important bit if( have_rows( ‘card’ … Read more

passing values from functions.php to template

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.

tax_query (if the terms are empty)

I would start by reorganizing your $args code to make more sense. $now = date(‘d-m-Y H:i:s’); $cat=”featured”; $args = $cat_args = array( ‘post_type’ => ‘events’, ‘posts_per_page’ => 4, ‘meta_key’ => ‘start_date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘start_date’, ‘value’ => date(‘Ymd’, strtotime(‘now’)), ‘type’ => ‘numeric’, ‘compare’ … Read more