Combine the vendor slug with the listing slug

Hi,

I’ve already tried to code this, but haven’t been successful yet. I’m trying to combine the vendor slug with the listing slug in the permalink. So, how can I change the permalink structure for listings to this:

/vendor/listing/

so, for example:

/peter-pan/green-jacket/

Thanks for you help!

Hi,

This is possible but will require additional customized WP Permalinks.
Vendor profiles are implemented as a custom post type “hp_vendor”, listings as a “hp_listing” post type and vendor ID is set in the “post_parent” field for listings.

Also. please check this topic wordpress - Include parent page slug in permalink for posts - Stack Overflow.

1 Like

Hi, Thanks heaps for you reply on this. Well, I’ve been playing around with the WP permalink functions and was partially successful. The tricky question is, how to get this working without a dedicated base-slug. When using /vendor/listing/ WP does not know which post type this is. So if there is another post that goes like /laptops/dell/ then WP does not know that this is NOT a hp_listing post type.

/peter-pan/green-jacket/ needs to be identified as of post type “hp_listing”

but /laptops/dell/ should not.

laptops is a constant base-slug, whereas peter-pan is somehow a dynamic base-slug (it depends on the vendor’s title). I think that is the tricky part.

Would you have any idea how to get this working?

Unfortunately, there is no simple solution, it requires advanced customization. If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.