When you register the CPT, use the rewrite
argument to add the prefix.
For example if your CPT is currently registered like this:
<?php
function wpse_create_cpt_testimonial() {
$args = array(
'public' => true,
'label' => __( 'Testimonials', 'textdomain' ),
// ... you probably have other arguments as well
);
register_post_type( 'testimonial', $args );
}
add_action( 'init', 'wpse_create_cpt_testimonial' );
?>
you can add rewrite
like this:
<?php
function wpse_create_cpt_testimonial() {
$args = array(
'public' => true,
'label' => __( 'Testimonials', 'textdomain' ),
// Here's the part where you're changing the URL
'rewrite' => array('slug' => 'results/testimonials'),
// If you want that URL to be an archive, add this line too
'has_archive' => 'results/testimonials',
// ... keep your other arguments as well
);
register_post_type( 'testimonial', $args );
}
add_action( 'init', 'wpse_create_cpt_testimonial' );
?>
If this doesn’t change things immediately, you may need to run unregister_post_type('testimonial')
right before re-registering it, and/or visit the Permalinks page to flush rewrite rules.