I have registered a custom taxonomy on "post" named "cat_modules" with this args:
'rewrite' => array(
'hierarchical' => true,
'slug' => '/',
'with_front' => false
)
I used 'hierarchical' => true
to have the url structure like 'category/subcateogry' and I used 'slug' => '/'
to remove the "cat_modules" from the slug.
These work well on the archive pages but all posts and pages return a 404 error.
If I remove 'slug' => '/'
from the args everything work well.
P.S In this web site is installed WPML.
I have registered a custom taxonomy on "post" named "cat_modules" with this args:
'rewrite' => array(
'hierarchical' => true,
'slug' => '/',
'with_front' => false
)
I used 'hierarchical' => true
to have the url structure like 'category/subcateogry' and I used 'slug' => '/'
to remove the "cat_modules" from the slug.
These work well on the archive pages but all posts and pages return a 404 error.
If I remove 'slug' => '/'
from the args everything work well.
P.S In this web site is installed WPML.
OK, so you've used /
as you taxonomy slug. It means that URL for your term is:
http://example/my-sample-taxonomy-term/
And for pages it will be:
http://example/my-sample-page/
As you can see, there is no way to guess, what type of post should WP search for.
WordPress processes the URLs looping through registered Rewrite Rules and matching given URL against regular expression assigned to current rule.
That means that in your case WP will take first rule that will match correctly and try to display that type of object. And because there are two different objects registering rules that are in conflict, then you'll get 404 errors for some of them.
category/subcateogry
just looks like a page calledsubcategory
that's a sub-page ofcategory
. – Jacob Peattie Commented Jan 12, 2019 at 13:45category\subcategory\post-title
. – S Madry Commented Jan 12, 2019 at 14:09