~canonical-sysadmins/wordpress/5.1

« back to all changes in this revision

Viewing changes to wp-content/themes/twentyseventeen/front-page.php

  • Committer: Haw Loeung
  • Date: 2016-12-13 06:54:17 UTC
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: haw.loeung@canonical.com-20161213065417-pemlo49o7in8nmkn
New upstream version 4.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * The front page template file
 
4
 *
 
5
 * If the user has selected a static page for their homepage, this is what will
 
6
 * appear.
 
7
 * Learn more: https://codex.wordpress.org/Template_Hierarchy
 
8
 *
 
9
 * @package WordPress
 
10
 * @subpackage Twenty_Seventeen
 
11
 * @since 1.0
 
12
 * @version 1.0
 
13
 */
 
14
 
 
15
get_header(); ?>
 
16
 
 
17
<div id="primary" class="content-area">
 
18
        <main id="main" class="site-main" role="main">
 
19
 
 
20
                <?php // Show the selected frontpage content.
 
21
                if ( have_posts() ) :
 
22
                        while ( have_posts() ) : the_post();
 
23
                                get_template_part( 'template-parts/page/content', 'front-page' );
 
24
                        endwhile;
 
25
                else : // I'm not sure it's possible to have no posts when this page is shown, but WTH.
 
26
                        get_template_part( 'template-parts/post/content', 'none' );
 
27
                endif; ?>
 
28
 
 
29
                <?php
 
30
                // Get each of our panels and show the post data.
 
31
                if ( 0 !== twentyseventeen_panel_count() || is_customize_preview() ) : // If we have pages to show.
 
32
 
 
33
                        /**
 
34
                         * Filter number of front page sections in Twenty Seventeen.
 
35
                         *
 
36
                         * @since Twenty Seventeen 1.0
 
37
                         *
 
38
                         * @param $num_sections integer
 
39
                         */
 
40
                        $num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );
 
41
                        global $twentyseventeencounter;
 
42
 
 
43
                        // Create a setting and control for each of the sections available in the theme.
 
44
                        for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {
 
45
                                $twentyseventeencounter = $i;
 
46
                                twentyseventeen_front_page_section( null, $i );
 
47
                        }
 
48
 
 
49
        endif; // The if ( 0 !== twentyseventeen_panel_count() ) ends here. ?>
 
50
 
 
51
        </main><!-- #main -->
 
52
</div><!-- #primary -->
 
53
 
 
54
<?php get_footer();