将HTML模板添加到WordPress
是否可以在没有PHP的情况下向WordPress添加HTML模板?客户向我发送了一个仅使用HTML,JavaScript和CSS迁移到他的WordPress帐户的模板,但据我所知
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
是否可以在没有PHP的情况下向WordPress添加HTML模板?客户向我发送了一个仅使用HTML,JavaScript和CSS迁移到他的WordPress帐户的模板,但据我所知
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
从技术上讲,是。 wordpress codex for them> them> them> them> them> them> them> them> them>§basic模板 contimplates cortives contimities contives 。
技术上说话,您可以重新名称
index.html
模板文件index.php
并包含style.css
符合WordPress规范的文件,以在 stylesheet标头 。这本身可以在WordPress中安装,并且可作为主题可用。但是,您对这不会特别有用的含义也是正确的,因为WordPress所使用的动态内容都不会被拉开并显示出来 - 模板本身并没有写出以利用适当的PHP来利用首先提取此数据的方法。您的客户可能会在标准网站模板与将与WordPress一起使用(或专门使用)可以很好地使用的标准网站模板之间的基本差异与将良好的基本差异之间的广泛鸿沟和以其他方式混淆。
您的客户所隐含的期望可能是您将其更新为将在WordPress环境中使用很有用的事物(尽管这肯定是可能的,尽管这可能是艰巨且耗时的,但取决于特定的要求) ,但是解释您和客户之间的通信在很大程度上超出了堆栈溢出的范围。
Technically, yes. The WordPress Codex page for Theme Development§Basic Templates mentions:
Technically speaking, you could re-name your
index.html
template file toindex.php
and include astyle.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.