I have a page template and i have assigned to a page name “business-profile”. So if you go to the page, the page URL is now “www.example.com/business-profile
“. But what i want to change is to replace the “business-profile” with the user name.
i have tried with the “page_link” filter. But it did not give the right output. So please can anyone say me the hook for this or any other way to get the url change in the particular page.
I have tried this also.
function wpd_append_query_string( $url, $id ) {
if( 42 == $id ) {
$url = add_query_arg( 'ngg_force_update', 1, $url );
}
return $url;
}
add_filter( 'page_link', 'wpd_append_query_string', 10, 2 );
But still it is not working. Because here it is changing some query. But i want to the page url or add the name in the URL.