Can someone explain to me where in the Twenty Seventeen theme in the static homepage is it directed to do a loop of pages rather than posts?

I don’t understand where it is doing this, from a fresh WordPress install.

In front-page.php I have this:

<?php
        // Get each of our panels and show the post data.
        if ( 0 !== twentyseventeen_panel_count() || is_customize_preview() ) : // If we have pages to show.

            /**
             * Filter number of front page sections in Twenty Seventeen.
             *
             * @since Twenty Seventeen 1.0
             *
             * @param $num_sections integer
             */
            $num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );
            global $twentyseventeencounter;

            // Create a setting and control for each of the sections available in the theme.
            for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {
                $twentyseventeencounter = $i;
                twentyseventeen_front_page_section( null, $i );
            }

    endif; // The if ( 0 !== twentyseventeen_panel_count() ) ends here. ?>

But where is the function code for the actual selection and output of these pages? I can’t find it.

Furthermore, this code is after what looks like a loop searching for posts, but in the theme, the pages appear before a page labelled Blog that has the posts within it… what’s that about?

I want to modify the theme to only pick certain pages so I’m interested in how it is generating the front page sections.

Read more here: Twenty Seventeen Pages Loop


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: