Show posts from multiple categories
-
I am trying to get a site set up that will show houses that are for sale by owner. I want the main site to have a single post for each house that is for sale, and I would like to use the custom fields to list certain details about each house (price, # of bedrooms, etc.).
One of the most important functionalities will be having the ability so search through the posts to identify properties that fall within a certain price, number of bedrooms, etc.
I am thinking of two completely different ways to go about this. One way is to search the custom fields and return results that match one or more of the parameters, which sounds difficult to say the least and does not allow for searching by ranges.
The way I think I would like to go about it is to categorize the posts in multiple categories depending on the price, bedrooms, bathrooms, etc. So, I might have categories for price of $126k to $150k, $151k to $175k, etc. and bathroom categories of 2+, 3+, and so on. Thus, a property would be categorized based on price, bathrooms, bedrooms, and so on.
My question is this: how can I search by category so the search returns only properties that belong to the multiple categories that are indicated? In other words, only posts that match ALL of the indicated categories should be returned rather than those that match ANY of the categories.
I’m also open to other ways of going about this, but the categories thing seemed easiest to me.
Thanks!
- The topic ‘Show posts from multiple categories’ is closed to new replies.