Parent Child Custom Permalink Rewrite Rule for Custom Post Type

Hi I have two custom post types, I am using the parent-child relationship between both like as,

store_name (parent)
store_offer (child)

I want to rewrite the permalink for the both like as

sitename.com/store/store_name
sitename.com/store/store_name/store_offer

Also, if there is no parent post specified then URL structure should be

sitename.com/store/global/store_offer

I have tried many tutorials but no luck. I just want to know what will be the correct “add_rewrite_rule” for those permalink structures?

Read more here:: Parent Child Custom Permalink Rewrite Rule for Custom Post Type

Leave a Reply

Your email address will not be published. Required fields are marked *