To clarify: I know how to change permalink structure in wordpress, no issue with that.
When a vendor creates a listing, the listing gets a title. Let’s say one user names their listing “test”
Now, let’s say another vendor creates a listing and also names their listing “test”
What happens is that a number is appended to the listing name for any duplicate listing if no other factor differs in the permalink.
So, the first listing would be: sitename.com/listing/test
rather than use the default ‘listing’ in the permalink, I want to use the vendor user name so the links differ since no two usernames can be the same. sitename.com/listing/{vendor-1}/test sitename.com/listing/{vender-2}/test
This would be a variable, though, and not possible to add on the permalinks page.
How would I achieve this? Is there a function that can be added?
I found a function in the documentation, but it is not for adding dynamic vendor name to the permalink structure (and the code doesn’t work):
For any one else who is experiencing this issue and wants to fix it without having to code, install “Custom Post Type Permalinks”
Under hp_listing enter:/%author%/%postname%/
if you want the default ‘listing’ base name to change, you can change it in the optional section already provided. Unfortunately, tags in that section do not work - they are converted to text - therefore the workaround is needed.
Caveat: There is a bug in the plugin when defining the product permalinks. It adds an extra forward slash. The workaround is to click default and not change anything for the woocommerce products. If that is more important to you, than this solution is not something that will work for you at the moment until the bug is resolved by the plugin devs. Note: This plugin is not a hivepress plugin.
Here’s hoping Hivepress will add the ability to include the author/vendor name in the urls for listings in the future.