Closed kevinkiel closed 7 years ago
It is strange...
The routes are handled/dispatched against the template_redirect
hook so all routing logic is happening before any WordPress template conditions is checked. As it is ran from an event, the functions.php
file has been read entirely before the route is even dispatched. This is also why the routes can be registered before being processed.
Are you using the latest commit for the framework and latest commit from the theme? I see you set your own namespace where the default is Theme\Controllers
for the routes.php
file which is now loaded from a custom RoutingServiceProvider defined in the theme in place of being just required from the functions.php
file.
Let me know how it goes. I'll test on my side using your location
custom post type slug.
I've just tested on a fresh installation. Indeed by default, it redirects to the page route. But after flushing the rewrite rules, it worked as expected. How it goes on your side?
Page:
Location post type (singular):
@jlambe thanks for the reply. We changed the theme options with your last commits. And for new install this works good. :) For existing installation we still got the same issue.
An other question: When do you release a steady release? 👍 We would like to work with releases instead of dev-master.
The date is not yet fixed but the release is coming right after the WordPress 4.7 release, so coming early january 2017.
I'm currently using "themosis/framework": "dev-master" (Version: 1.3.0)
I've registered a post type called 'location'
Now I add a custom post called amsterdam (/location/amsterdam). And I add a normal page called amsterdam (/amsterdam).
When I visited the page '/location/amsterdam' it redirects to the normal page '/amsterdam' and it ignores the custom post type route.
How is that possible?
We'eve figured out this happens before the route is being dispachted so it happens somewhere after the functions.php and before route dispatching. We we're hoping you could help us with this issue
This is what my route files looks like:
` Route::group(['namespace' => 'App\Controllers'], function() {
}); `