对于某一个页面
,我想为它单独设置一种样式,完全不同于其他文章。该怎么操作呢?
非常好办。
template-spring-field.php
<?php
/*
Template Name: Spring Field Page
*/
?>
<p>This is spring field page.</p>
<?php the_post() ?>
<h2><?php the_title() ?></h2>
<p><?php the_content(); ?></p>
/页面属性/模板/
中选择 Spring Field Page
。保存,查看这个页面。哈哈,你想要的效果就有了。
本节代码 step05
template
开头,只是这样命名的能更明显的把模板类文件区分出来