将HTML模板添加到WordPress

发布于 2025-02-10 19:56:41 字数 96 浏览 1 评论 0 原文

是否可以在没有PHP的情况下向WordPress添加HTML模板?客户向我发送了一个仅使用HTML,JavaScript和CSS迁移到他的WordPress帐户的模板,但据我所知

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清旖 2025-02-17 19:56:41

是否可以在没有php的情况下向WordPress添加HTML模板?

从技术上讲, wordpress codex for them> them> them> them> them> them> them> them> them>§basic模板 contimplates cortives contimities contives 。

至少,WordPress主题由两个文件组成:

  • style.css
  • index.php

技术上说话,您可以重新名称 index.html 模板文件 index.php 并包含 style.css 符合WordPress规范的文件,以在 stylesheet标头 。这本身可以在WordPress中安装,并且可作为主题可用。

但是,您对这不会特别有用的含义也是正确的,因为WordPress所使用的动态内容都不会被拉开并显示出来 - 模板本身并没有写出以利用适当的PHP来利用首先提取此数据的方法。您的客户可能会在标准网站模板与将与WordPress一起使用(或专门使用)可以很好地使用的标准网站模板之间的基本差异与将良好的基本差异之间的广泛鸿沟和以其他方式混淆。

您的客户所隐含的期望可能是您将其更新为将在WordPress环境中使用很有用的事物(尽管这肯定是可能的,尽管这可能是艰巨且耗时的,但取决于特定的要求) ,但是解释您和客户之间的通信在很大程度上超出了堆栈溢出的范围。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文