admin管理员组文章数量:1122846
I am trying to edit the home page for the wordpress site but I am not able to find the PHP file. The file should be under the theme file and I have checked almost all the file(which is not the correct way) but was not able to find it. Looking for some way through which I can get the exact file name via URL as in CodeIgniter we use ROUTES.PHP, if there is any way. Thanks in advance.
I am trying to edit the home page for the wordpress site but I am not able to find the PHP file. The file should be under the theme file and I have checked almost all the file(which is not the correct way) but was not able to find it. Looking for some way through which I can get the exact file name via URL as in CodeIgniter we use ROUTES.PHP, if there is any way. Thanks in advance.
Share Improve this question asked May 1, 2017 at 9:53 Nikhil GuptaNikhil Gupta 1112 bronze badges1 Answer
Reset to default 0WP determines template file by following Template Hierarchy. The process has quite a few steps between URL and resulting PHP file loaded, so generally one is not a reliable indication of the other.
Outside of looking through likely template files (good enough in a simple theme) you can try dumping this with code in template_include
filter or using some debug plugin. For example Query Monitor shows main template file loaded.
Note that in more complicated theme (especially private ones) the actual PHP file might be deeply nested/included from the initial template file.
本文标签: theme developmentHow to get php file based on URL in WordPress
版权声明:本文标题:theme development - How to get php file based on URL in WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736291402a1928716.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论