conditional tag for search.php
-
I’m using conditional tags in the search.php to identify the type of posts presented (by adding something to the title: like “Upcoming event” or “News”). This works with:
<?php if ( get_post_type() == 'evenementen' ) { ?>
But now I need to make sure that events that have passed today’s date are identified as “Archived event”.
This is what I’ve done so far for the upcoming events:<?php // Get today's date in the right format $todaysDate = date('Y-m-d / H:i'); $argsue = array( 'post_type' => 'evenementen', 'meta_key' => 'Wanneer', 'meta_compare' => '>=', 'meta_value' => '' . $todaysDate . '' ); ?> <?php if (in_array($argsue)) { ?>
But this is not working. Hope someone can help me with this!
Thanks in advance, John.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘conditional tag for search.php’ is closed to new replies.