Custom Post Types – how to get the URLs I want?
-
Howzit forum – 1st, I’ve tried looking, but it’s likely I dont’ know the correct terms for what I’m trying to do, because I’m not finding any answers.
I’m working on a travel info site and have created custom post types for hotels and nightlife, which resides at
example.dev/hotels/
example.dev/nightlife/If I create “Imperial Hotel” it can be found at example.dev/hotels/imperial-hotel/
This is fine, but as the site grows, I’m want the establishments to be findable by city/town – data I already capture in the custom post type’s meta data.
So the Imperial Hotel is in capital city, which also has a nightlife – Capital Club (very creative examples, yes).
So ideally, because I’m under the impression it’s good SEO to do it like this, the URLs should be
example.dev/capital-city/hotels/imperial-hotel
example.dev/capital-city/nightlife/capital-clubWith pages this was not a problem. Imperial hotel could be a child of hotels which in turn was a child of capital city.
But I have no idea how to achieve this with custom post types in the most efficient way.
Should I rethink my data structure / custom post types or can it be done in some other way?
I also struggle with deciding and determining which structure would be best. Should it be
State
— Capital City
—- Hotel
—- Nightlife
— Beautiful City
—- Hotel
—- Nightlifeor should it be
State
— Hotel
—- Capital City
—- Beautiful City
— Nightlife
—- Capital City
—- Beautiful CityAny help is greatly appreciated.
- The topic ‘Custom Post Types – how to get the URLs I want?’ is closed to new replies.