Hello @adcfy ,
Thanks for contacting us.
Hope you are doing well, Add the below code snippet in your active theme’s functions.php file.
function mycred_change_badge_post_type_args( $args, $post_type ) {
if ( 'mycred_badge' === $post_type ) {
$args['rewrite']['slug'] = 'new-badge-url';
$args['rewrite']['with_front'] = false;
}
return $args;
}
add_filter( 'register_post_type_args', 'mycred_change_badge_post_type_args', 10, 2 );
Let me know if it’s working for you.
Thanks & Regards,
WP Experts Support Team
-
This reply was modified 7 months, 2 weeks ago by
Daniyal Raza.
Thread Starter
adcfy
(@adcfy)
Thank you very much for your attention
With the code you gave, the links changed correctly, but the content of the page does not show anything and it is 404.
Hey @adcfy ,
Thanks for the update.
function mycred_flush_rewrite_rules() {
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'mycred_flush_rewrite_rules' );
The above code will flush the rewrite rules whenever the theme is switched. You can then switch the theme temporarily and switch back to your default theme to regenerate the rewrite rules.
Let me know if you have any question.
Thanks
Thread Starter
adcfy
(@adcfy)
Thank you very much for your kind support
My problem is completely solved.
We appreciate a kind and honest review regarding support to you.