Roots Discourse

How to include the category in the URL?

So i have a post type called knowledge base
and i am going to have posts under categories. So it would look like

the thing is that if i click go to my first post, lets say “random_post” that belongs to the category “Category 1”

instead of seeing
It says

Where can you change it so it includes the category on the URL?

Also how would you do the blade file for the categories? would it be category-slug.blade.php?

If you want to make custom urls, you’re going to need to dig into WordPress’s Rewrites API. This post (though old) has a pretty decent walkthrough for how that works: The short version is that you have to tell WordPress how to parse particular URL segments into query terms it can understand.

As for the blade file, look at the hierarchy and determine what filename matches the endpoint you want:

This topic was automatically closed after 42 days. New replies are no longer allowed.