To add the vehicle category in the vehicle detail permalink, add the below code in the child theme’s functions.php.
add_filter( 'cdhl_cars_cpt_cars', 'cardealer_child_extend_cpt_cars' ); function cardealer_child_extend_cpt_cars( $args ) { $args['rewrite']['permastruct'] = '/vehicles/%vehicle_cat%/%postname%'; // The above structure will generate the URLs of the vehicle detail as below. // For "cars" category: https://example.com/vehicles/cars/chevrolets-dart/ () // For "bikes" category: https://example.com/vehicles/bikes/suzuki-gr-150/ return $args; }
You can adjust the code as per your requirements.