Note that there are some explanatory texts on larger screens.

plurals
  1. POsearch form having 2 input fields
    primarykey
    data
    text
    <p>I need to create a search for (wordpress site)form having 2 input fields. 1. A dropdown field, consisting all categories. and 2. a basic text input which would search the whole site.</p> <p>I was using a plugin (advance-wp-query-search-filter.1.0.10) but it is not working. When i select a category, the meta title and the meta description is getting generated but no posts is getting displayed.</p> <p>I was trying to get all the categories and combine with the single input text search button. code for getting all the categories into a dropdown menu:</p> <pre><code>&lt;li id="categories"&gt; &lt;h2&gt;&lt;?php _e('Categories:'); ?&gt;&lt;/h2&gt; &lt;form action="&lt;?php bloginfo('url'); ?&gt;" method="get"&gt; &lt;div&gt; &lt;?php wp_dropdown_categories('show_count=1&amp;hierarchical=1&amp;taxonomy=coupon_category'); ?&gt; &lt;input type="submit" name="s" value="view" /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/li&gt; </code></pre> <p>what i want is, there should be 2 inputs (dropdown &amp; text input) and a common search button which would submit both or any one input which is provided by the user.</p> <p>My single input text search button is working fine. How can i combine multiple input fields ?</p> <p>EDITED CODE - </p> <pre><code> &lt;form role="search" method="get" id="searchform" action="&lt;?php bloginfo('siteurl'); ?&gt;"&gt; &lt;div&gt; &lt;label class="screen-reader-text" for="s"&gt;Search for:&lt;/label&gt; &lt;input type="text" value="" name="s" id="s" /&gt; &lt;?php wp_dropdown_categories('show_count=1&amp;hierarchical=1&amp;taxonomy=coupon_category'); ?&gt; &lt;input type="submit" id="searchsubmit" value="Search" /&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>The above code, displays a search box with 2 inputs, which are dependent on each other. I want it to work independently having a common submit button. if i input a category and search, the search results should be according to the category, and if i search only a normal text input, the result should be according to the input text. and if i input both the fields, i want the search result to get populated with respect to the input text box.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload