get terms that have post with custom post type between 2 values

This is the finish code for this: <?php $dates_array = array(); $countries_array = array(); $term_list = array(); $current_term_list = array(); $args = array( ‘post_type’ => ‘tours’, ‘posts_per_page’ => -1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); global $post; $tour_terms = wp_get_post_terms( $post->ID, ‘tours_cats’ ); $current_term_list = array(); foreach ($tour_terms … Read more

How to update a custom post title from a front-end form using ACF fields?

You check if !$value before assigning the title from the fields, that test will be false once the post has a title. If you always want it to update, then remove the test. function auto_title_insert() { return $_POST[‘fields’][‘field_538626f57e84c’].’ ‘.$_POST[‘fields’][‘field_538627ffeccb0′].’ ‘.$_POST[‘fields’][‘field_53863a5c7502b’].’ ‘.$_POST[‘fields’][‘fields[field_53a9bb09f82ba]’]; } add_filter( ‘title_save_pre’, ‘auto_title_insert’ );

Order Custom post type loop by custom field (datepicker)

Your second approach should in my mind actually work, you do it like this: Code: $args = array( ‘post_type’ => ‘agenda’, ‘posts_per_page’ => -1, ‘meta_key’ => ‘datum_agenda’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); $my_query = new WP_Query( $args ); There are two pages at the ACF documentation you might want to read: Date Picker … Read more

Query by 2 values of a repeater ACF field

I know this is an old question, but I thought I’d post the answer in case anybody else is facing the same problem. functions.php: function add_cond_to_where( $where ) { //Replace showings_$ with repeater_slug_$ $where = str_replace(“meta_key = ‘showings_$”, “meta_key LIKE ‘showings_%”, $where); return $where; } add_filter(‘posts_where’, ‘add_cond_to_where’); Query: //Replace showings_$ with repeater_slug_$ //Replace _discounts with … Read more