Relevanssi - A Better Search
[resolved] wp_dropdown_categories() returning all results (4 posts)

  1. guit4eva
    Posted 1 year ago #

    Awesome plugin! I just have a small problem though:

    I'm using custom taxonomies and am trying to build a search that is restricted to a city, such as All Libraries in SmallVille, using:

    <form id="searchform" method="get" action="<?php bloginfo('url'); ?>">
        <input type="text" name="s" id="s" size="15" class="city"> <p class="in">in</p>
        <?php wp_dropdown_categories('taxonomy=location&show_option_all=Select city&exclude=1'); ?>
        <div class="submit-button"><input type="submit" value="Search" /></div>

    Unfortunately, which ever city is selected still brings up all results in all cities. Is there some special trick I need to do to get it to work?


  2. Mikko Saari
    Plugin Author

    Posted 1 year ago #

    Try changing

    wp_dropdown_categories('taxonomy=location&show_option_all=Select city&exclude=1');


    wp_dropdown_categories('taxonomy=location&name=location&show_option_all=Select city&exclude=1');

  3. guit4eva
    Posted 1 year ago #

    Oh my goodness, I can't believe that just adding 'name=location' would have saved me five hours of head banging ha ha:) But awesome, it works!!! Thanks so much, your plugin is definitely the best I've ever tried!! :D

  4. Mikko Saari
    Plugin Author

    Posted 1 year ago #

    The default value is not particularly helpful there, yes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic