Is it possible to add an HTML template to WordPress, without PHP? A client sent me a template with only HTML, JavaScript and CSS to migrate it to his WordPress account, but as far as I know it is not possible
CodePudding user response:
Is it possible to add an html template to wordpress, without php?
Technically, yes. The WordPress Codex page for Theme Development§Basic Templates mentions:
At the very minimum, a WordPress Theme consists of two files:
- style.css
- index.php
Technically speaking, you could re-name your index.html
template file to index.php
and include a style.css
file that's conformant to the WordPress spec to include the requisite theme metadata in the stylesheet header. That in itself would be installable into WordPress and usable as a Theme.
However your implication that this wouldn't be particularly helpful is also correct, because none of the dynamic content that WordPress would be used for would be pulled through and displayed out of the box – the template itself isn't written to leverage the proper PHP methods to pull this data in the first place. Your client is likely undereducated, misinformed, or otherwise confused on the wide gulf of fundamental difference between a standard website template and one that will work well with (or is specifically created for use with) WordPress.
Your client's implied expectation may be for you to update it into something that would be useful to use in a WordPress environment (which is most certainly possible, albeit likely arduous and time-intensive depending on the specific requirements), but interpreting communications between you and your client is much outside the scope of Stack Overflow.