老实说,我现在还不懂 PHP。但我想要实现的目标在我脑海中听起来很简单。
这是我的 wordpress single.php
文件顶部的代码:
<?php get_header(); ?>
我创建了一个单独的 header ,即 header2.php
。
我想知道我需要在我的 single.php
模板顶部写什么来调用 header2.php
而不是 header.php
?
最佳答案
如果你想要 header-2.php(而不是 header2.php)你必须调用:
<?php get_header('2'); ?>
查看此页面:http://codex.wordpress.org/Function_Reference/get_header
关于php - 如何调用单独的 header.php?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13983065/