0
  1. Custom post type --- Event
  2. custom taxonomy----- myevents
  3. Using Jquery Date picker for Start date and End date
  4. Search field for searching event name

I want to fetch the custom post type events by using the simple form search. In which i fetched custom taxonomy in select option, then I added start and end date using Jquery Date picker at last Search field.

My search URL looks like this: - http://localhost/customthemedev/?categoryfilter=Techfest&Start=01-May-2019&End=10-May-2019&search=smoke+event+

  <form class="select-event-date" method="GET" action="<?php bloginfo('home'); ?>" autocomplete="off" id="filter">
                     <div class="form-group eventfunction">
                     <label>Categories</label>
                     <select class="form-control" name="categoryfilter">
 <?php
    $tax_terms = get_terms('myevents', array('hide_empty' => '0'));      
   foreach ( $tax_terms as $tax_term ):
       echo '<option value="'.$tax_term->name.'">'.$tax_term-name.'</option>';   
    endforeach;
 ?> </select> 
                     </div>
                     <div class="form-group selectDate">
                      <input type="text" class="form-control" placeholder="Start Date" name="Start" id="txtFrom">
                     </div>
                     <div class="form-group endDate">
                      <input type="text" class="form-control" placeholder="End Date" name="End"  id="txtTo">
                     </div>
                     <div class="form-group searchEvent">
                     <label><img src="<?php echo get_template_directory_uri();; ?>/assets/images/search-22.png" alt="Icon"></label>
                      <input type="text" placeholder="Search.." name="search">
                     </div>
                    <button type="submit" class="btn btn-default">FIND EVENTS</button>
                  </form>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.