Change permalink of "Projects" i.e. /portfolio/
-
Hi i need to work with project types and i want to change the /portfolio/ permalink i see this forum post from 2016 https://xtemos.com/forums/search/project+permalink/ but quite complex, do you have another solution ? Thanks for answer
Hello,
Navigate to Dashboard > Pages and find Portfolio page and change the page title.
Best Regards
Thanks for fast answer, very useful !
Also for next people tell to select on right side the portfolio template
all the best
Sorry but it’s not working
Please have a look here https://arg.baliboa.com/prestations/
Should go to /prestations/name but still go to /portfolio/name
When i install theme i think i had delete the default portfolio page
But i test with another website i just begin to work on with your theme same problem
https://v2.zeenea.com/test-name/ don’t go to /test-name/name
I update permalinks and change browser same
Any idea/solution
Thanks
Try to add the following PHP code snippet to the child theme functions.php file to do this
add_filter('register_post_type_args', 'portfolio_to_my_slug', 10, 2);
function portfolio_to_my_slug($args, $post_type){
if ($post_type == 'portfolio'){
$args['rewrite']['slug'] = 'my_slug';
}
return $args;
}
Thanks but it’s not working, permalink is ok with /prestations/ but project pages are in 404.
Did i wrote correctly, please check (once prestations in place of my-slug)
add_filter(‘register_post_type_args’, ‘portfolio_to_my_slug’, 10, 2);
function portfolio_to_my_slug($args, $post_type){
if ($post_type == ‘portfolio’){
$args[‘rewrite’][‘slug’] = ‘prestations’;
}
return $args;
}
After adding the code, try to resave your permalinks via Settings -> Permalinks.
Yes that’s it !
Thank you
The topic ‘Change permalink of "Projects" i.e. /portfolio/’ is closed to new replies.