Empty slug for rewrite?
-
Hi!
Many have pondered this, here, here and here.
So the scoop is that with this:
register_post_type( 'test', array(..., 'rewrite' => array('slug' => '', 'with_front' => true)));
(Some instructions have with_front as
false
but it doesn’t work that way either)One could get post URLs without the ugly ‘test’ in front. But it does not work in 3.2.1 for me at least. Anyone got it working?
Empty slug ” it only redirects to the
/test/post-name/
. With'/'
as slug I get 404. With'a'
as slug it works just fine it redirects to'/a/post-name/'
but I don’t want any prefix.To refresh the permalinks I always go to
/wp-admin/options-permalink.php
and save, it seems to refresh them if I put single char to the slug for instance.P.S. I also have flush_rewrite_rules() in activation hook.
- The topic ‘Empty slug for rewrite?’ is closed to new replies.