Removing “category” from URLs then “add_endpoint()” won’t work…

For example, the original URL would be http://localhost/category/sub_category/.

What I want is http://localhost/sub_category/, furthermore, I want to add an endpoint to the URL which looks like http://localhost/sub_category/endpoint/.

I’ve removed the “category” from the URL successfully by following this tutorial https://jonnyjordan.com/blog/how-to-remove-category-from-your-urls-in-wordpress/ .

But once I remove the “category” from the url, the add_rewrite_endpoint( 'endpoint', EP_CATEGORIES ) won’t work…

0

Leave a Comment