Add category base to url in custom post type/taxonomy
Change your rewrite to add the course query var: ‘rewrite’ => array(‘slug’ => ‘courses/%course%’) Then filter post_type_link to insert the selected course into the permalink: function wpa_course_post_link( $post_link, $id = 0 ){ $post = get_post($id); if ( is_object( $post ) ){ $terms = wp_get_object_terms( $post->ID, ‘course’ ); if( $terms ){ return str_replace( ‘%course%’ , $terms[0]->slug … Read more