remove a particular custom post type slug from the url in wordpress -


how remove particular custom post type slug url in wordpress 4.7

here link http://dmstage.com/gardencity/projects/bridge-construction/

but need should come http://dmstage.com/gardencity/bridge-construction/

the projects should removed link..i tried rewrite in functions.php..but couldnot correct way it..

thanks in advance..

try creating function :

function na_remove_slug( $post_link, $post, $leavename ) {  if ( 'events' != $post->post_type || 'publish' != $post->post_status ) {     return $post_link; }  $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );  return $post_link; } add_filter( 'post_type_link', 'na_remove_slug', 10, 3 ); 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -