an
groups-icon

How to add search by custom field/taxonomy option in header

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Syed Gulzar Ali
    0 points
    Beginner

    Hello guys,
    I want to setup an advanced search under the header. How can i add a custom field/taxonomy to the advanced search? I have used the following code to add a taxonomy called “City” in the search. It displays the list of cities i added but when i chose a city it returns the ID of the city instead of the name. So the search is not working e.g it outputs
    wordpress/?s=&cat1=&tx_city=78
    78 is the ID of that option. The search works fine if ” tx_city=NameOfCity “. Is it possible for it to return the name of taxonomy option instead of its ID or is there any other way to do it?
    Thanks
    [code title=”Adding taxonomy field in search”]
    <div class=”col-md-3″>
    <select name=”tx_city” class=”form-control”>
    <option value=”0″>
    City
    </option>
    <?php echo $CORE->CategoryList(array(0,false,0,’city’)); ?>
    </select>
    </div>
    [/code]

    August 11, 2015 at 11:55 am
  • Leon Brown
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 13, 2015 at 11:21 pm
  • Leon Brown
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 13, 2015 at 11:25 pm
  • Syed Gulzar Ali
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 14, 2015 at 7:49 pm
  • Leon Brown
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 14, 2015 at 7:58 pm
  • Syed Gulzar Ali
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 14, 2015 at 8:05 pm
  • Leon Brown
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 14, 2015 at 8:15 pm

786

Views

6

Replies