Automatically attach subpage to taxonomy terms
I’m creating sports news page which popularizes some not “well known” sports. It has “Sports” taxonomy, which has terms “Sport 1, Sport 2, Sport 3”. It is used for displaying sport-specific posts on taxonomy’s term page.
What I want to do is to add same set of sub-pages to every sport (which is Sports taxonomy term as I said) and display links to them in single sport’s page header. So it would be something like this:
Sports Taxonomy
–Sport 1
–history, rules pages
–Sport 2
–history, rules pages
–Sport 3
–history, rulas pages
…the same for every sport.
I have problem with how to approach this. Sports taxonomy is registered on init via plugin I’ve written. I could easily make Sports taxonomy hierarchical and manually add “history” and “rules” term to every Sport via admin panel. But it’s not efficient (I would have to repeat same action for every sport) and I would like this to be done automatically for every new sport.
I could create another taxonomy “history” and “rules” but it also seems like a way around and making a mess in my admin panel structure.
I’m fairly new to wordpress and my problem seems like pretty “common” one but I haven’t found any reasonable example on the web :/ Could anyone help me with this?
Leave an answer