Title: conditional tag for search.php
Last modified: August 19, 2016

---

# conditional tag for search.php

 *  [johnklijnen](https://wordpress.org/support/users/johnklijnen/)
 * (@johnklijnen)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/conditional-tag-for-searchphp/)
 * 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)

 *  Thread Starter [johnklijnen](https://wordpress.org/support/users/johnklijnen/)
 * (@johnklijnen)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/conditional-tag-for-searchphp/#post-1917622)
 * Is this a mission impossible or am I missing something very obvious? Please, 
   could someone help me with this?

Viewing 1 replies (of 1 total)

The topic ‘conditional tag for search.php’ is closed to new replies.

## Tags

 * [conditional tags](https://wordpress.org/support/topic-tag/conditional-tags/)
 * [date](https://wordpress.org/support/topic-tag/date/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [johnklijnen](https://wordpress.org/support/users/johnklijnen/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/conditional-tag-for-searchphp/#post-1917622)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
