I'm asking if it's possible to call a php page or to define a link without having to define the folder "detectmobile" where it is located ?
require (get_template_directory() . '/detectmobile/header_settings_page.php') ;
Is there a search function in the template that will query the presence of a specific php page in each folder?
Does exist a function that do that ?
require (get_template_directory() . '/*/header_settings_page.php') ;
detectmobile
a folder you're using or an example? Can you provide more context for the problem this is trying to solve? What are you trying to achieve that requires this? Note that searches are expensive/slow, and a wildcard in arequire
statement is not possible, and would have negative security consequences if it was. The more specific you can make your question that better the answers you will get, and the more people will participate. Use theEdit
link under the tag list to improve the questionlocate_template( 'foo/header_settings_page.php', true )
be troublesome to you? And even if there was such function in question, what ifheader_settings_page.php
existed in bothfoo/
andfoo2/
, orfoo/a/
andfoo/b/
? How would you determine which one should be loaded? Have you considered storing the relative path to the database instead, e.g. via a post meta?