Multiple Query Values in URL
-
Have Googled high and low for an answer to this one. I want to pass on multiple values to use as variables on a page that then shows posts that match those variables. I cannot work out how to add more than one variable to the URL though in functions.php
So at the moment I have this working
https://example.com/?minBeds=1
but I want to build the URL out to something likehttps://example.com/?minBeds=1&maxBeds=4
Using this one works…
function add_query_vars_filter( $vars ){ $vars[] = "minBeds"; return $vars; } add_filter( 'query_vars', 'add_query_vars_filter' );
But obviously I’d like to add maxBeds, minPrice, maxPrice etc.
Help please!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Multiple Query Values in URL’ is closed to new replies.