You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set a new route ( in my routes.php located in my theme, or in web.php route file located in PROJECT_ROUTE/routes/web.php ) using a custom template, but this is not working.
I am also getting the same issue here. however in my case when I use is_page_template('template-name') function it's returning true. therefore what i do is check using the is_page_template() and returning the view accordingly at the controller level. that's a work around and it's not good, since the template routing is documented.
Description
I'm trying to set a new route ( in my routes.php located in my theme, or in web.php route file located in PROJECT_ROUTE/routes/web.php ) using a custom template, but this is not working.
Steps to reproduce
Here is the content of my templates.php file :
Then I go to the wordpress backoffice and I create a new page and with my custom-template model.
In my routes files I have set this :
When I try to access to my page with my custom template, It returns the view in the PageController@index instead of the one in PageController@custom.
And when i try log this in my controllers : $query->is_page_template() It returns false.
Expected behavior
I should get the view rendered from PageController@custom.
Thanks you .
The text was updated successfully, but these errors were encountered: