[wp-hackers] Bulding a full search form?

Diana K. C dianakac at gmail.com
Fri Oct 5 00:54:56 UTC 2012

Hi there,

Í'm having some spare time to get to know about searching content in WP, I 
found some weak plugins, tips etc still anything helped at all.

In single meta_key I manage to search it this way:

Add this functions/plugin:

    global $wp;

And form would be:

<form action="<?php echo home_url(); ?>/" method="get" id="searchform">
      <input class="input" name="s" type="text" id="keywords" value="" >

            <select name="meta_value" id="img_post_country" >
            <option value="" selected="selected">Select pet gender</option>
            <option <?php if(isset($action_edit_image)){ ?> 
selected="selected" <?php } ?> value="<?php _e('Male','wp_pet');?>"><?php 
            <option value="<?php _e('Female','wp_pet');?>"><?php 

     <input type="hidden" name="post_type" value="pet" />

             <input type="submit" name="search" value="<?php 
_e('Search','cosmotheme') ?>">

There's no way to search more than a meta_key with this, it would be nice if 
I could set the meta_key name in the input name instead of "meta_value", 
then I could use more than one meta_key. I tried but doesn't work :(

 I found this also 

Beside the fact I'm lacking knowledge on post data e sessions, is this a 
sort of a hack?


More information about the wp-hackers mailing list