How to set “with_front’=>false” to a plugin-generated cpt?

As Mark explained, you will need to return $newvar. That should work. Also, please reset the permalink once. (I mean, go to Permalinks section in dashboard and click ‘Save changes’ button without making any changes. It will flush rewrite rules and build them again.)

If it still does not work, then I think below snippet may help. Check if that works. I found it here

add_filter('eventon_register_post_type_ajde_events', 'fix_event_slug', 10, 1);

function fix_event_slug($arr){
$new_ar = array('rewrite' => array('with_front'=>false, 'slug'=>'events'));
return array_merge($arr, $new_ar);
}

After adding above section, please reset the permalinks.

Leave a Comment