0

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.

0

WP 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.

1
  • yes in my case the file was 3 level deep, I was looking for someway through which I can get the file but I dont think it exists. Anyways thanks for the help buddy. – Nikhil Gupta May 2 '17 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.