Wordpress custom post permalink structure inside custom post permalink -
i have custom post structure this:
mysite.com/custompostname/customposttitle
and need have 1 more custom post type have depedency myfirst custom post type permalink be:
mysite.com/custompostname/customposttitle1/custompostname2/custompost2title1 mysite.com/custompostname/customposttitle1/custompostname2/custompost2title2
mysite.com/custompostname/customposttitle2/custompostname2/custompost2title3 mysite.com/custompostname/customposttitle2/custompostname2/custompost2title4
etc..
i have news section custom posts in permalink, example:
mysite.com/companies/company1/news/news1
is there way achieve this?
you can customise permalink custom post type, needs hardcoded in rewrite parameter given register_post_type. use categories achieve same thing though: set taxonomy first custom post type , use posts create custom taxonomy second cpt (i.e. posts first cpt become categories second).
so add pseudo-code edit page second cpt:
- get posts of type 'cpt1'
- loop through them create list of checkboxes
- display in metabox
- save result
there still hoops jumped through urls going right place, it's start.
Comments
Post a Comment