Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am making a theme for a hotel, and I need to be able to provide functionality to search by the following custom fields: Location and Price. I need to be able to query them from the query string itself... ie:

yoursite.com/?post_type=rooms&location=south

yoursite.com/?post_type=rooms&price=20.95

yoursite.com/?post_type=rooms&location=north&price=35

I have found many different questions/answers to this, but none of them seem to specifically address my issue.

This one, notably, I believe is really close to solving the issue for me: Query posts and filter at query time by value of custom meta

It doesn't make much sense to me. I am used to PHP, however I am new to WordPress as a CMS.

share|improve this question
add comment

1 Answer

I managed to figure it out (finally) after about 12 hours of screwing around.

The answer here gave me 98% of the answer, and the rest was simply using the appropriate hooks to modify it for my use and to include the postmeta table.

share|improve this answer
add comment

Your Answer

 
discard

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.