Avatar of dinko1
dinko1
 asked on

Define "area" in each wordpress post

In a wordpress site, I have the need to assign an "area" for each post. Areas has three levels. City -> Position -> Area like "Athens -> Center -> Sintagma". Users must be able to filter all "Athens" or all "Center" or specifically all "Sintagma" posts. What is the best way to do it? Adding a custom field? Please explain with as many details as possible. Don't forget that I need to use this and filter posts. Also, if I have to pay for a commercial plugin its ok with me. I prefer to have everything setup in control panel, I dont like to write custom php code.
WordPress

Avatar of undefined
Last Comment
dinko1

8/22/2022 - Mon
Jason C. Levine

Why not just use categories?
dinko1

ASKER
This is the "as much detail as possible" answer? :)
Also, I already have a "Category" for each post like "Beauty", "Spa", "Hair", "Auto-Car" etc...
Jason C. Levine

This is the "as much detail as possible" answer? :)

1. Wasn't an answer so much as a clarifying question :)

2. It's not the length, it's how you apply it.

Also, I already have a "Category" for each post like "Beauty", "Spa", "Hair", "Auto-Car" etc...

So?  Have more than one category (it's supported).  One set of top-level categories for things like Beauty, Spa, etc. and a second tree of hierarchical categories:

City
- Position
-- Area

By placing a post in the "thing" top level category and also in the lowest level of the hierarchy above (e.g. "Beauty" and "Sintagma") you get two URLs for that post:

yourdomain.com/beauty/post-title
yourdomain.com/athens/center/sintagma/post-title

and can then look into plugins that do front-end filtering by category...
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
dinko1

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jason C. Levine

It's not necessarily the "right" way so much as it's the "other" way to do it.  You can have custom taxonomies set up that do hierarchical sorting or just extra "categories" but the net effect is the same.
dinko1

ASKER
Much like the built-in Categories and Tags, custom taxonomies allow you to define an organization within your custom post types. It works just like the regular categories, but is so much better because you get to define the exact name your taxonomy uses.

Taxonomies can be used to organize the display of your content on the front-end of your website as well, they are not just for administration. This means that your website becomes much easier to navigate for your users!

That is why Wordpress crew invented "Taxonomies" a different approach of the "Categories".
dinko1

ASKER
taxonomies is the right way to define custom categories in Wordpress
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.