August 2017
Beginner
412 pages
10h 30m
English
The last template we're going to create is for the static page view. On my food blog site, this would be the sample page, for example. The easiest way to go about this is to start with the single.php file this time. So, just make a copy of this file and name it page.php. Now, we'll be simplifying the file so that only the essential information about a given page is displayed. In the end, this is what my page.php file looks like:
<?php get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php while (have_posts()) : the_post(); ?> <?php get_template_part('content', 'page'); ?> <?php endwhile; // end of the loop. ?> </main><!-- #main --> </div><!-- #primary --><?php get_sidebar(); ...Read now
Unlock full access