Comments 3BroccoliStudio started the conversationOctober 3, 2020 at 1:20pmHi, I would like to add prefix to blog posts like this one: domain.com/news/xyzNot like this: domain.com/xyzhere is an example: https://demo.kaliumtheme.com/construction/news/https://demo.kaliumtheme.com/construction/young-architects-on-the-rise/But I would like to show like this one: https://demo.kaliumtheme.com/construction/news/young-architects-on-the-rise/ 1,558Laborator repliedOctober 5, 2020 at 7:54amHi there,By default WordPress will apply the blog slug to every post type so to disable this you have to add a code to the functions of the child theme. Can you try adding this code to the functions.php of the child theme: /** * Set 'with_front' to false for the 'portfolio' post type. */ add_filter( 'register_post_type_args', function( $args, $post_type ) { if( 'portfolio' === $post_type && is_array( $args ) ) $args['rewrite']['with_front'] = false; return $args; }, 99, 2 ); And then add the news under permalinks so it will be applied only in the blog posts and not the whole site.Best regards,Laborator Team Documentation Join Kalium Users Group Sign in to reply ...
Hi,
I would like to add prefix to blog posts like this one:
domain.com/news/xyz
Not like this: domain.com/xyz
here is an example:
https://demo.kaliumtheme.com/construction/news/
https://demo.kaliumtheme.com/construction/young-architects-on-the-rise/
But I would like to show like this one:
https://demo.kaliumtheme.com/construction/news/young-architects-on-the-rise/
Hi there,
By default WordPress will apply the blog slug to every post type so to disable this you have to add a code to the functions of the child theme.
Can you try adding this code to the functions.php of the child theme:
And then add the news under permalinks so it will be applied only in the blog posts and not the whole site.
Best regards,
Laborator Team