0
<input type="search" id="<?php echo esc_attr( $unique_id ); ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentytwenty' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />

Default search have only one input field search with name="s" but I want to add another input field so user can input there age or pincode manually and result will be relative.

<input type="search" id="<?php echo esc_attr( $unique_id ); ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentytwenty' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />

<input type="search" id="id" class="search-field" placeholder="age" value="<?php echo get_search_query(); ?>" name="s2" />

now user can enter there name age in both input field.

  • You want that user can find make search on the basis of keyword and pin-code, and keyword and pincode will relatively used on basis of OR. Am I right? – BlueSuiter Jan 8 at 12:20
  • i think you are not clear about it. i want both input field like name and age. – Atif Aqeel Jan 8 at 12:23
  • Results will be shown on basis of both the inputs using AND relation in query. – BlueSuiter Jan 8 at 12:26
  • i need guide how to do it. – Atif Aqeel Jan 8 at 12:28
  • You have to create the functionality for this as WordPress search does not support such kind of search. Functions to be written will be based on the way you want to use for showing data that is, using ajax or using page reload. Tell me, what way you want to use. – BlueSuiter Jan 8 at 12:30

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.