thank you, I already tried that plugin and many more but this plugin doesnt offer solution to my problem. I also tried wrote my own function with no luck. I find something in comments (check 1.png please) and thats totally exact case but function doesnt work for me. Maybe its outdated or just inacurate. I think Themenectar would be able to help me with it in few minutes, can you please escalate me to him?
It's fairly straightforward to create a custom permalink structure for custom post type taxonomies, however if you're trying to add a base to your Taxonomy which matches the same base of the single project template, that's where you'll hit a default limitation of WordPress and the single template will display 404.
If you want your project-type taxonomy to use the structure /portfolio/kategorie/*category/ then the portfolio post type slug would need to be changed To anything other than "portfolio" in order to make that work by default. If you're okay with them being different then your snippet of code can be changed to simply be as follows:
add_action('init', 'themes_dir_add_rewrites');
function themes_dir_add_rewrites()
{
global $wp_rewrite;
$wp_rewrite->extra_permastructs['project-type']['struct'] = '/projects/kategorie/%project-type%';
}
In that example, the taxonomy base is made to be "projects" to allow your single portfolio pages to still function e.g. https://bizkit.studio/portfolio/3wiss-logo/
Ensure to regenerate your permalinks after adding that snippet in by going to Settings > Permalink in your WP admin and clicking save changes.
ThemeNectar, thank you very much for your explanation.
One last thing... Im using custom filter / function that uses is_archive() and it include portfolio. I cannot find right exclude rule for it. I already tried && !is_tax, && !is_singular( $post_types = 'project-type' ) etc. Cannot find the right one.
If you need to exclude the portfolio archives from your logic, you can use the following:
if (!is_post_type_archive('portfolio') &&
!is_tax('project-type') &&
!is_tax('project-attributes')) {
// code to execute when not on a portfolio archive
}
Hello Salient team,
My portfolio archive have this URL structure: /blog/project-type/*category/
and I would like to change it to: /portfolio/kategorie/*category/
Can you please provide me custom filter or function to achieve this?
Hey Again,
This should help:https://wordpress.org/plugins/custom-permalinks/ .
Thanks
ThemeNectar Support Team
Hello Tahir,
thank you, I already tried that plugin and many more but this plugin doesnt offer solution to my problem. I also tried wrote my own function with no luck. I find something in comments (check 1.png please) and thats totally exact case but function doesnt work for me. Maybe its outdated or just inacurate. I think Themenectar would be able to help me with it in few minutes, can you please escalate me to him?
Hey Again,
Thanks for the additional information. Escalating this to the developer.
Thanks
ThemeNectar Support Team
Hey nox28w,
It's fairly straightforward to create a custom permalink structure for custom post type taxonomies, however if you're trying to add a base to your
Taxonomy which matches the same base of the single project template, that's where you'll hit a default limitation of WordPress and the single template will display 404.
If you want your project-type taxonomy to use the structure /portfolio/kategorie/*category/ then the portfolio post type slug would need to be changed
To anything other than "portfolio" in order to make that work by default. If you're okay with them being different then your snippet of code can be changed to simply be as follows:
In that example, the taxonomy base is made to be "projects" to allow your single portfolio pages to still function e.g. https://bizkit.studio/portfolio/3wiss-logo/
Ensure to regenerate your permalinks after adding that snippet in by going to Settings > Permalink in your WP admin and clicking save changes.
Wouldnt below solution "make space" for /portfolio/kategorie/*category/?
Adding a dynamic piece to the permalink structure would actually be a decent amount of code. However, the plugin https://wordpress.org/plugins/custom-post-type-permalinks/ makes this particular task easy.
With that active, you can simply add /%project-type%/%postname%/ to the portfolio section within the permalink options:
Unfortunately that still won't allow the taxonomy permalinks to use "portfolio" as the base (if the single portfolio is using it).
ThemeNectar, thank you very much for your explanation.
One last thing... Im using custom filter / function that uses is_archive() and it include portfolio. I cannot find right exclude rule for it. I already tried && !is_tax, && !is_singular( $post_types = 'project-type' ) etc. Cannot find the right one.
Hey nox28w,
If you need to exclude the portfolio archives from your logic, you can use the following:
Kind regards,