Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Load PHP file if parent and child of parent Re: Load PHP file if parent and child of parent

#134757
DrCLue
Member

Not a wordpress user , but I do way too much PHP [probably need a 12 step program by now] :)
depending on exactly what you want and how wordpress is actually laid out , one might find the
get_included_files function useful as it maintains a list of all the files involved in the production of any page. Then one could have some simple XML ,JSON, or even plain old text file where you could store your rules that could be read in to decide when and where to include content.

Another possibility that might be easier is some sort of .htaccess mod-rewrite rule that you could set in any directory you liked that could add something to the url so you would only have to check for one thing in the PHP but otherwise not have to fiddle with the PHP scripts after the one time.

Generally I try in my PHP projects to generify and externalize things so I don’t have to be editing PHP files. To many other aspects of development that are much more fun.