Hi there,
I worked on permalinks too before on my past projects, and it’s bit tricky and complex. What you doing here is just changing the look of your URL, but you’re not passing the correct data back to the page where the identity is still the original slug. There is no universal solution on this, it’s always goes down to custom coding depending on the usage or requirement.
Example,
This /x-portfolio/machupicchu-peru/
can be masked as /slug-parent-1/machupicchu-peru/
and it will work just as is (when viewing the page in front). But with the internal data, you need a custom rewrite to tell the system that /slug-parent-1/
represents /x-portfolio/
too, then pass any data through query_var
. Depending on your local system (theme/plugin), you’ll retrieve the values from query_var
and use it depending on the feature you’re working on.
Hence, there could be many different plugins, themes, features, multiple permalinks, unlimited slug nesting and so on, there is no permanent solution. It all depends on what you need to implement.
Masking is different from the actual existence of the URL’s identity where data is assigned and registered.
Even if we’re able to fix and implement this (our own custom multiple portfolio permalink), and user still uses that custom permalink plugin that’s only doing the masking, it will still not work.
Thanks!