Hi There – i am trying to show all films that are shown on a certain day.
The date is a sub field (in row 1) of the screening info repeater field. It all works except when i try and compare the value of the screening date and the certain day (21/3/15). It doesn’t return any results (even though there should be) & says there are no films on. The return format of the date picker field is: 06/03/2015. I think there must be something wrong with the value, but I can’t figure it out! Any help much appreciated.
$the_film_query = new WP_Query(array(
‘post_type’ => ‘films’,
‘posts_per_page’ => -1,
‘meta_query’ => array(
‘key’ => ‘screening_1_date’,
‘value’ => ’21/03/2015′,
‘compare’ => ‘=’
what is the value of screening_0_date?
if you dont filter/compare you should get it like that
<?php $your_date = get_field('screening_0_date'); //variable like in array (if array has a <h1>titel</h1> it shows you the value as it is at "code-editor") echo '<pre>'; echo htmlspecialchars(print_r($your_date,true)); echo '</pre>'; ?>
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.