有没有办法只调用一次页眉和页脚而不在每个模板中调用它
Is there a way to call the header and footer only once without calling it in each templates
我正在寻找一种与自定义模板分开调用页眉和页脚的方法
Right now I have to call them like this :
<?php /* Template Name: Page Home */ ?>
<?php get_header(); ?>
<div>
my page
</div>
<?php get_footer(); ?>
But I want to find a way to call those elsewhere and only once so that I don't have to call them again in custom templates.
我不知道 wordpress,但是如果你可以创建视图模板,你可以创建一个带有页脚和页眉的基本模板,然后在控制器中调用这个文件。
我正在寻找一种与自定义模板分开调用页眉和页脚的方法
Right now I have to call them like this :
<?php /* Template Name: Page Home */ ?>
<?php get_header(); ?>
<div>
my page
</div>
<?php get_footer(); ?>
But I want to find a way to call those elsewhere and only once so that I don't have to call them again in custom templates.
我不知道 wordpress,但是如果你可以创建视图模板,你可以创建一个带有页脚和页眉的基本模板,然后在控制器中调用这个文件。