Some note about your code – no need to comment it with “not working”, as it’s meant as explanation, not as “solution” to work something out through guessing.
Saving data
This is the most annoying thing: No one should save date and time in different columns. Just makes no sense. At least PHP date and time handling class is named DateTime
for a reason.
About date( 'Y-m-d' )
: You know that this gives you just the current day back?
Data types
Meta queries allow for type
arguments and got DATE
and DATETIME
available. Then there’s no possibility to date()
on time values. There’s time()
(for the current time) for it.
$agenda_arg = array(
'post_type' => 'agenda',
'cat' => $cat_id,
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'agenda_date',
'value' => date( "Y-m-d" ),
'type' => 'DATE',
'compare' => '>='
),
array(
'key' => 'agenda_time',
'value' => time(),
'type' => 'DATETIME',
'compare' => '>='
)
),
);
As last note: I’d try dropping the agenda_time
array first just to see if it works.