Support » Plugins and Hacks » Relevanssi - A Better Search » wp_dropdown_categories() returning all results

  • Resolved guit4eva

    (@guit4eva)


    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>
    </div>
        <div class="submit-button"><input type="submit" value="Search" /></div>
    </form>

    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?

    https://wordpress.org/plugins/relevanssi/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)


    Try changing

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

    to

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

    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!! 😀

    Plugin Author Mikko Saari

    (@msaari)


    The default value is not particularly helpful there, yes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_dropdown_categories() returning all results’ is closed to new replies.