Custom Post Type as a Parent of another Custom Post Type

Question

I am trying to create a coupon website for which I have created 2 custom post types “Vendor” and “Coupons”.

Basically, I first want the user to add a vendor and then upload coupons through the front-end form.

The URL structure I am expecting is www.domain.com/vendor/coupons/

Here /coupons/ page will be the archive page for coupons for the selected vendor.

For this, I have created vendor CPT with the hierarchical feature as “true“.

I have read various posts on StackOverflow that say rewriting URLs is an answer to this. But the problem with that was It was showing coupon individual post page and not archive page. Also, I am using wp user frontend pro for collecting frontend submissions which don’t allow selecting parent while creating a new post.

For the coupon feature, I am using 4 custom fields using ACF: “Vendor”, “Coupon title”, “Coupon Description” & “Coupon code”.

Here the vendor field can be used for filtering out the results of the coupons archive.

Please guide me on the correct way of implementing this kind of feature.

0
GoSSDHosting 2 months 2021-05-20T14:22:19-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse