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

python - PyInstaller UAC not working in onefile mode -

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -

wso2is - WSO2 IS 5.0.0 SP1 After restart there is authentication error -