-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtemplate-page_template.php
More file actions
42 lines (40 loc) · 1.46 KB
/
template-page_template.php
File metadata and controls
42 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Template Name: Custom Page Template
* Template Post Type: page
*
* @package WordPress
* @subpackage Project_Zero
* @since 0.3
*
* You can use any file name for custom page templates, as long as the headers above are used.
* However, using the format template-{template_name}.php may help distinguish these files from others in your theme.
* Or not. I'm not the boss of you.
*
* DO NOT use page- as a template prefix, as WordPress uses this as a specialised page template.
* page-{slug}.php and page-{id}.php would be assigned to pages with that specific slug or ID instead of the custom template.
* That's not me telling you, that's WordPress.
*
* For more information, check out
* @link https://developer.wordpress.org/themes/template-files-section/page-template-files/
*/
get_header();
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<section id="page-title" class="page-title">
<div class="container">
<h1><?php the_title(); ?></h1>
</div> <!-- .container -->
</section> <!-- #page-title -->
<section id="page-<?php the_ID(); ?>" class="single-page container page-container">
<main id="page-content" <?php post_class() ?>>
<article class="post-content">
<div class="entry">
<?php the_content(); ?>
</div> <!-- .entry -->
</article> <!-- .post-content -->
</main> <!-- #page-content -->
</section> <!-- #page-{page_id} -->
<?php
endwhile; endif;
get_footer();
?>