WordPress 具有内容的自定义模板
示例
我们将进一步扩展模板,并包括页面标题和内容
<?php
/*
Template Name: Example
*/
get_header();
the_title();
the_content();
get_footer();而且,如果您愿意,可以用这样的HTML元素包装它们
<?php /* Template Name: Example */ get_header(); echo '<h1>' . the_title() . '</h1>'; echo '<section> . 'the_content() . '</section>'; get_footer();
或者,如果您喜欢像普通HTML文件那样工作,而无需使用echo
<?php /* Template Name: Example */ get_header(); ?> <h1><?php the_title(); ?></h1> <section><?php the_content(); ?></section> <?php get_footer(); ?>
热门推荐
1 狗狗技能训练
5 如何训练狗狗笑
6 狗狗训练排便
9 狗狗响片训练
10 如何训练狗狗不捡食
11 狗狗尿训练
12 怎么训练狗狗找东西
13 狗狗训练站立
14 狗狗训练飞盘
15 鞍山狗狗训练
16 怎样训练泰迪狗狗谢谢
17 狗狗外出训练
18 怎么训练金毛狗狗大小便