Can't change /destination/ url path

Hi, I’m trying to change the /path/ url following your tutorial https://www.support.waituk.com/hc/en-us/articles/360001005614-Change-destination-path-in-URL-to-custom-path.

I’ve done exactly the same you posted in the tutorial, but i hadn’t had sucess so far…

I have the url "index.com/destination/italy-tours, however i’m not able to change it. What could be the reason? Could you give me some help with this?

Thanks

Hi, did you change the custom-destination part in your code? If so, can you please post the code block from your entrada-child themes functions.php so that I can test it for you and let you further?

Ty

Hi Sanjeev, yes I made the change to “destinos”.

I copy and paste the code

/* Custom Destination Text */
add_action( ‘init’, ‘entrada_destination_url_rewrite’ );
if( ! function_exists( ‘entrada_destination_url_rewrite’ ) ) {
function entrada_destination_url_rewrite() {

$custom_text = ‘destinos’; // Change this value to what you want to show inplace of destination

add_rewrite_rule( “^”. $custom_text ."/([^/])$", ‘index.php?destination=$matches[1]’, ‘top’ );
add_rewrite_rule( “^”. $custom_text ."/([^/]
)/([^/]*)$", ‘index.php?destination=$matches[2]’, ‘top’ );
}
}

add_filter( ‘term_link’, ‘entrada_change_destination_permalink’, 10, 3 );
if( ! function_exists( ‘entrada_change_destination_permalink’ ) ) {
function entrada_change_destination_permalink( $url, $term, $taxonomy ) {

$custom_text = ‘destinos’; // Change this value to what you want to show inplace of destination

$taxonomy_name = ‘destination’;
$taxonomy_slug = ‘destination’;

// exit the function if taxonomy slug is not in URL
if ( strpos( $url, $taxonomy_slug ) === FALSE || $taxonomy != $taxonomy_name ) return $url;
$url = str_replace( ‘/’ . $taxonomy_slug, ‘/’ . $custom_text, $url );
return $url;
}
}

Sanjeev any update about this? My boss is demanding me a solution, we have to show a demo tomorrow to our client