I have a true false field (hide_on_public_page)
here is my code in my template:
// The Query
$today = date (‘Ymd’, strtotime(‘-6 hours’));
$future = date (‘Ymd’, strtotime(‘+4 Months’));
$event_query = new WP_Query(
array(
‘post_type’ => ‘al_event’,
‘orderby’ => ‘menu_order’,
‘order’ => ‘ASC’,
‘meta_query’ => array(
array(
‘key’ => ‘event_date_end’,
‘compare’ => ‘>=’,
‘value’ => $today,
),
array(
‘key’ => ‘event_date’,
‘compare’ => ‘<=’,
‘value’ => $future,
),
array(
‘key’ => ‘hide_on_public_page’,
‘value’ => ‘0’,
)
),
) );
This code works, but the problem is that I want to show the fields unless “hid_on_public_page” has been clicked. This seems to only work if checked otherwise there is no value in the field. What would I do to make sure that the posts show up if a user hasn’t clicked that true/false field?