Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to create a category page where it lists the posts in a specific category. However I need to have a dropdown search field which will filter the posts within the category.

So let's say I have the parent category "Business" and under there, I need different types like "commercial", "industrial", "non-profit"...etc.

I am not sure if it is better to make those as sub-categories or should they be tags?

And how will that work in relation to the search filter that I need?

To make this even more difficult, I added a meta value of date which needs to be filtered also. So the page has a filter for the type and another filter for the date.

Any insights appreciated.

share|improve this question

closed as not constructive by toscho Jul 29 '12 at 20:28

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

Whether to use categories or tags depends on the intended use. The primary differences is that categories are hierarchical, which means that you draw associations to not only the category applied, but also its parent (and potentially child) categories as well. Tags don't relate to each other like that.

For example, lets say I were categorizing an apple. I would put it in the category food and it's subcategory fruit, but I would tag it things like red, sweet, and fall, since those are more descriptors.

In terms of application, categories are to help users and search engines find all your content, tags are to help users find related content and to help search engines categorize content.

So the answer to your question really lies in how you intend the site to be used. Are you wanting users to look at just commercial businesses and not non-profits, or merely to know that the listed business is a commercial business?

On the meta value issue, how is this date different from post_date? I'm a big fan of sticking to core capabilities wherever possible, if post date isn't something that will be used or better yet, if it makes sense in the context, just use post date to handle the date. This gives you the added advantage of retrieval with the post object, rather than needing a separate query, which saves (an admittedly minimal amount of) resources and makes coding easier.

share|improve this answer
Well I am not sure if I classify types of business as descriptors or category thus I am asking opinions. I need date because I am listing them by EVENT date (when the event will take place), not posted date of the post. My main concern now is how do i conduct a search dropdown with either tags or sub-categories when I have to include custom meta field of the date as well...thanks. – Rick Jan 8 '12 at 4:42
Unfortunate about the date it does muddy things. Without seeing the site, I'm not comfortable offering any further guidance as to category vs tag, it sorta depends on the number of each. I try to keep tags relatively small and relatively specific whereas I try to keep categories broad so that the user doesn't end up on an archive page with much less than 5 posts if at all avoidable. – m0r7if3r Jan 8 '12 at 4:57
At first I was keen on using all categories because I can use the wp_dropdown_categories to list all my sub-categories. But tags are easier to search with in the URL, thus I was torn between the two. Dropdown will not work with tags because tags are NOT tide to any specific categories. To make matters even worse, I need this to work with pagination...hehe...thanks for the help anyways. – Rick Jan 8 '12 at 5:02
Pagination is super easy, so don't sweat that, it's just /page/2, maybe a bit of code, but wordpress is super about that. You could create a tags dropdown that just listed all the tags, but if you wanted grouped tags, those would just be categories, so categories seems like the way to go. – m0r7if3r Jan 8 '12 at 5:09

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