Answer the question
In order to leave comments, you need to log in
How to assign a post of a custom type as the parent page of a post of another custom type, or what to do if you have no experience and half the brain?
Hello! I ask the Greats for help)
Thanks to the register_post_type () function, I have three arbitrary post types: Names, Offers, Experience. Taxonomies by category type are registered for Offer and Experience. How to get nested url like Site/Name/Offers/Category/Post-offer and Site/Name/Experience/Category/Post-experience? In Offers and Experience, I can only assign pages of the same type as the parent page. How to overcome it?
I'm confused, I'm all lost.
As a result, I should also have pages Names with all names (i.e. url of the type Site / Names and Site / Names / Name), Offers with all offers and the ability to select a category (i.e. url of the form Site / Offers and Site /Offers/Category), Experience - as in Offers. It worked, but what about the nesting of the url from the question? Now I display both Offers and Experience on the Site / Names / Name page (I connected through arbitrary fields Names and Offers and Names and Experience), the final url is obtained in the form Site / Offers / Post-Offer (similarly with Experience). But I need it differently, as in the first paragraph ...
Tell me please, maybe you need to think in the other direction? How to put it all together?
Well, I re-read it and got upset - it’s not logical, because if a visitor went, for example, to an Offer Post that has a url like Site/Name/Offers/Category/Offer Post from the Site/Offers/Category page. Actually, I don't think anymore. Mess in my head. And sawdust.
Please save the stupid me. How to organize? Where to read?
Please do not swear too much - I'm completely new to website building ...
Answer the question
In order to leave comments, you need to log in
Do you distinguish colors? Even here in the text of the question, the error is clearly highlighted - in the second line, the quotation mark and bracket are not closed.
Porridge
or what to do in the absence of experience and half the brain?
I thought for a long time ... But I came up with it) It may be completely wrong, but the logic is this. For each "Name" I made child pages "Offers" and "Experience" with separate templates; using add_rewrite_tag,
add_permastruct, and add_rewrite_rule, made the references for records of type Offers and Experience to the form Site/Names/Name/Offers/Category/Sentence Post and Site/Names/Name/Experience/Category/Experience Post. As a result, I got the necessary working structure and a bunch of duplicates) But this is a completely different story, the question about duplicates with my code is here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question