WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying out a couple of plugins to aid in searching of taxonomy terms. One is called "Query Multiple Taxonomies" and the other is called "Drop-down-custom-taxonomy".

What I'm wanting to keep the page I'm searching from when I begin the search. For example if the page I'm on is dogs (www.site.com/dogs) and I run a search on this page for a taxonomy called "breed", and find all dogs that are a "beagle", the url is changed to this:


How can I get the url to stay with /dogs in it?


Based on my limited knowledge, I'd say this is a job for url rewriting? I did try adding some code for a base url for Query Multiple Taxonomies but this did not work with my permalink structure of /%year%/%postname%/

share|improve this question

Just change the action attribute of your search form in your theme, for example;

<form action="<?php echo home_url( $GLOBALS['wp']->request ); ?>" method="get">

This will dynamically output the URL of the current request, so that when a user searches, the query string is simply appended to it, rather than pointing back at the root.

share|improve this answer
Thanks, nice tip. This fixes the default WP search box but it doesn't have any effect on the taxonomy dropdowns I am using. They still start searching from the homepage. I found that Query Multiple Taxonomies has a "base URL" filter that can be set but it doesn't work with my /%year%/%postname%/ permalinks. github.com/scribu/wp-query-multiple-taxonomies/wiki/… – Andrew Jul 5 '11 at 23:23
The other plugin uses the following. Perhaps I can modify the window.location.href? <script type="text/javascript"> jQuery(document).ready(function($){ $("select#{$id}").change(function(){ window.location.href = $(this).val(); }); }); </script> – Andrew Jul 5 '11 at 23:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.