PHP to check if file exists in a folder for child ← (PHP, CSS)
one text
I am wanting to have a basic child theme check that works similar to how WP does it.
I have specific files for things like header, footer, content, part etc. much like WP does in its main theme. I want to be able to add a short piece of code in each of those files to check if another (same_named.php) file exists in (dynamic) folder named theme_(anyname).
I did a few tests from much older posts, e.g, PHP Check if dynamic named folder exists
But how do I get it to check for a specific folder and a specific file name that matches the original.
Is there a way to also check for css files as well the same way? I am guessing we can't do the check in the css file itself?
Thanks for your help, it is appreciated.
Source
See also:
About the technologies asked in this question PHP PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.https://www.php.net/
CSS CSS (Cascading Style Sheets) is a formal language for describing the appearance of a document written using a markup language.
It is mainly used as a means of describing, decorating the appearance of web pages written using HTML and XHTML markup languages, but can also be applied to any XML documents, such as SVG or XUL.https://www.w3.org/TR/CSS/#css
Welcome to programmierfrage.com
programmierfrage.com is a question and answer site for professional web developers, programming enthusiasts and website builders. Site created and operated by the community. Together with you, we create a free library of detailed answers to any question on programming, web development, website creation and website administration.
Get answers to specific questions
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Help Others Solve Their Issues
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.