Closed grappler closed 9 years ago
Hi @grappler
in Cortex, there is no permalink structure: there is a completely new way to handle urls: in Cortex you connect a kind of url to a query.
If you want that an url like example.com/{cat}/{post_name}
display your post, of course you can have it.
You need to set 2 variable parts in the url and assign them to a query.
Something like:
Brain\Routes::add( '/{cat}/{name}' )
->requirements([
// next line ensure that {cat} is a valid category slug
'cat' => implode('|', wp_list_pluck(get_categories(), 'slug')),
])
->query( function( $matches ) {
return ['name' => $matches['name']];
});
Do you have any simple examples for changing the permalink structure for cpts?
I would like to get this structure but I am not sure it is possible?
example.com/{cat}/{post_name}
Thank you.