custom post type: gallery taxonomy: gallery_type (ex terms: photo, video)
domain.com/gallery/ > all 'gallery' custom posts domain.com/gallery/video > all 'gallery' custom posts belonging to 'video' term domain.com/gallery/video/my-fabulous-gallery-1 > the 'gallery' custom post called 'My Fabulous Gallery 1'
I think this is quite a common problem. In the past I already solved it in various ways with the use of
add_rewrite_rule() and some regexp astro-magics. Ok.
Since register_post_type/taxonomy do have a rewrite option (which I usually use for simple things), I wonder: are there more elegant and less involved ways to achieve the results I want?
Also, after changing the rules/routes/rewrites, I'd like to have wordpress to correctly generate links and things like that, using its standard functions (
get_the_permalink() etc...). How to?
There's an old and quite good article out there:
If you take a look to "Manipulating WordPress Rewrites" you'll see they suggest ways to achieve what I want, but they don't work perfectly. I get the first 2 urls, but this one will not work:
it will redirect to the standard one: