0

Please give me a suggestion this situation of mine. I have a custom post type "house". It comes with 2 custom taxonomies: "region" and "status".

I would like to get out all the "house" which are "for rent" and are located in "istanbul" of "turkey"when I type this URL to the browser:

hostname.com/for-rent/turkey/istanbul

Thanks

  • Do you already have the page ready to display the posts? – Tobias Beuving May 12 '16 at 15:45
  • Yes I do. I want to detect the URL segment to modify the query now. – Trang May 12 '16 at 15:49
0

You can use a rewrite rule in your htaccess:

/for-rent/turkey/istanbul

RewriteRule ^for-rent/([^/]*)/([^/]*)$ yourpage.php?country=$1&city=$2 [L]

Than in your yourpage.php:

$country = $_REQUEST['country'];
$city = $_REQUEST['city'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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