0

This question already has an answer here:

I want to change the url structure for custom post type

post type --> movies

This url structure sitename.com/movies/post-name need to change sitename.com/custom-taxonomy/movies/post-name

/%customtaxonomy%/%customposttype%/%postname%/

marked as duplicate by Jacob Peattie, Krzysiek Dróżdż, Dan Gayle, bosco, Jack Johansson Oct 22 '18 at 16:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Although your structure is the other way round, setting rewrite to %custom_tax%/movies should work just as well – kero Oct 8 '18 at 11:27
0

I think you have to create your own rewrite rule for that custom post type.

Example creating a rewrite rule :

function custom_rewrite( $wp_rewrite ) {
    $feed_rules = array(
        'reviews/(.+)/(.+)'      =>  'index.php?post_type=movies&taxonomy_name='.$wp_rewrite->preg_index(1).'&post_name=' . $wp_rewrite->preg_index(2)
    );
    $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
// refresh/flush permalinks in the dashboard if this is changed in any way
add_filter( 'generate_rewrite_rules', 'custom_rewrite' );

Not the answer you're looking for? Browse other questions tagged or ask your own question.