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

问题描述 投票:0回答:1

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

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

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

javascript html wordpress wordpress-theming custom-wordpress-pages
1个回答
0
投票

您需要以.php扩展名的所有这些页面,在所有这些静态页面上添加以下本机函数get_header get_hooter

facts.php

<?php get_header(); ?>

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

<?php get_footer(); ?>
© www.soinside.com 2019 - 2024. All rights reserved.