WordPress.org

Make WordPress Core

Ticket #42820: 42820.1.patch

File 42820.1.patch, 3.5 KB (added by Hardik Amipara, 6 months ago)

"but WTH" : it removed in comment

  • src/wp-content/themes/twentyseventeen/front-page.php

     
    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 int $num_sections Number of front page sections.
    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();
     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
     15get_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.
     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 int $num_sections Number of front page sections.
     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();