I'm rebuilding this website (which is static at the moment): hidden link. The new site will be dynamic, so I've created a custom post type called "drive-in-shows" for my products.
I would like to keep the structure of my current site, which is classified by target groups. So there's a seperate archive for weddings, another archive for birthdays, another archive for company parties etcetera.
However, the single product pages differ a bit per target group as well. The price and most of the specifications are the same for each target group, but the description is taylored for a specific target group. The URL differs per target group as well (for example, sitename/targetgroup-1/product-1, sitename/targetgroup-2/product-1)
So now I have like 6 different products, and each product has 4 different pages (1 for each target group).
In the new site, I'd rather NOT have 4 different custom post types (1 for each target group), with the same products in them (only the description differs). I guess there must be a better way, but I can't think of any... please advise.
Hi,
Thank you for contacting us and I'd be happy to assist.
The way WordPress rewrites rules and permalink structure works, I can't think of any straightforward way to achieve this.
At the basic level, WordPress permalink structure expects this format:
sitename/{post-type-slug}/{post-slug}
But, in this case, you're looking for unique permalinks based on taxonomy terms (target groups), for each single product post.
Something like this may be possible using complex custom rewrite rules, but it will require advanced customization and you can discuss it at specialized WordPress forums like:
https://wordpress.stackexchange.com/
If you're open to the idea of having ugly or URL parameters-based links, you can create a single page '/drive-in-shows/'.
sitename/drive-in-shows/
And then generate links with URL parameters, specifying which target group and product to use:
sitename/drive-in-shows/?targetgroup=targetgroup-1&product=product-1
sitename/drive-in-shows/?targetgroup=targetgroup-2&product=product-1
sitename/drive-in-shows/?targetgroup=targetgroup-3&product=product-1
sitename/drive-in-shows/?targetgroup=targetgroup-4&product=product-1
.........
And based on those URL parameter values, you can control which content is shown when that page is viewed.
regards,
Waqar