2017-02-18 68 views
0

特定页面我做了一个自定义的PHP头文件,并把它命名为header-membersclub.php,取而代之的是这个代码的默认标题行中page.php如何创建一个单独的头在WordPress的

<?php 
if(is_page(7)) { 
    get_header('membersclub'); 
} else { 
    get_header(); 
} 
wp_head(); 
?> 

但由于某种原因它不工作。有人可以帮助我吗?我不知道我做错了什么。

+1

更具体与您的问题,包括代码示例 –

+0

提供屏幕截图也因为它给出了一个更好的主意,你要实现这一点,你的整个WordPress的布局结构。 – user7568042

+0

尝试在http://wordpress.stackexchange.com/上发布它 – Jadeye

回答

1

我更新了你的代码:

<?php 
if(is_page($post->ID)) { //checking the current post not only 7 
    get_header('membersclub'); 
} else { 
    get_header(); 
} 
?> 

我删除wp_head();那是后话,应该是里面<head>

相关问题