- 主题创建,再themes目录下创建一个文件夹,例如:cs

- .创建style.css和index.php文件,后台就多一个主题,启用


- .定义style.css
1.Theme Name:主题名称
2.Theme URI:主题地址
3.Author:作者
4.Author URI:作者地址
5.Description:描述
- Version:版本号
7.License:开源协议
8.License URI:开源协议地址
9.Tags:标签
10.Text Domain:主题目录


三.创建header.php和footer.php,注意看头部和底部的body和html标签组合起来是闭合的
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>测试</title>
</head>
<body>
<?php echo '我是头部';?>
<?php
echo '我是底部';
?>
</body>
</html>


四.index.php加载头部和底部
<?php
get_header();
echo '我是首页';
get_footer();
?>


五.创建archive.php,下面是一个简单的archive.php的代码
<?php
get_header();
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo "<br/>";
echo "我是标题:";
echo "<br/>";
the_title();
echo "<br/>";
echo "我是时间:";
echo "<br/>";
the_date();
echo "<br/>";
echo '我是内容:';
echo "<br/>";
the_content();
echo "<br/>";
endwhile;
endif;
get_footer();
?>


六.创建single.php,可以看到single.php是没有循环的单个文章
<?php
get_header();
echo "<br/>";
echo "我是标题:";
echo "<br/>";
the_title();
echo "<br/>";
echo "我是时间:";
echo "<br/>";
the_date();
echo "<br/>";
echo '我是内容:';
echo "<br/>";
the_content();
echo "<br/>";
get_footer();
?>

