如何在静态 html 页面中使用默认的 wordpress 页眉和页脚

how to use default wordpress header and footer in static html page

我有一个位于 "public_html" 文件夹的 wordpress 网站,我将静态 HTML 页面名称 facts.html 上传到 public_html/nutritionfacts 中的新文件夹,可以说它非常简单喜欢:

<html>
<body>
<h1> FACTS </h1>
</body>
</html>

如何将默认的网站页眉和页脚添加到新的静态 html 页面?如果我有 1000 个静态页面,最好的方法是什么。

您需要 .php 扩展中的所有这些页面,在所有这些静态页面上添加以下本机函数 get_header get_footer,您的页眉和页脚将会出现。

facts.php

require '../../wp-load.php';

<?php get_header(); ?>

   echo "<html>
    <body>
    <h1> FACTS </h1>
    </body>
    </html>";

<?php get_footer(); ?>