- alkkdlkx
4 分钟 24 秒之前 - tmhvrb
4 分钟 35 秒之前 - vvqfyciu
4 分钟 36 秒之前 - detqjlm
4 分钟 39 秒之前 - bjebss
4 分钟 43 秒之前 - nlkepn
4 分钟 48 秒之前 - cwuuwc
4 分钟 48 秒之前 - kntqia
4 分钟 48 秒之前 - 自动的功能还是少用~
1 小时 53 分钟之前 - 自动的功能还是少用~
1 小时 54 分钟之前
该函数从当前主题文件夹中包含header.php模板文件。如果指定名称,那么函数将包含一个特殊的头部文件header-special.php。如果主题中没有header.php文件,那么函数会包含默认主题wp-content/themes/default/header.php的头部文件。
<?php get_header( $name ); ?>
$name
(字符串)(可选)对header-name.php的调用
默认值:None
包含非默认头部文件
<?php
get_header('myheader');
?>
简单的404页面
下面是一个为“HTTP 404: Not Found”错误(在主题文件中为404.php)而制作的简单模板。
<?php get_header(); ?>
<h2>Error 404 - Not Found</h2>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
多个头部
不同页面的不同头部信息
<?php
if ( is_home() ) :
get_header('home');
elseif ( is_404() ) :
get_header('404');
else :
get_header();
endif;
?>
get_header()位于wp-includes/general-template.php中。
get_header, get_sidebar, get_search_form, comments_template, get_footer()
发表新评论