Where is have_posts defined?
-
I am trying to understand wordpress. I looked at the code for index.php under the twentynineteen theme. This is the home page of the site.
bash-5.0# cat wp-content/themes/twentynineteen/index.php <?php get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main"> <?php if ( have_posts() ) { // Load posts loop. while ( have_posts() ) { the_post(); get_template_part( 'template-parts/content/content' ); } // Previous/next page navigation. twentynineteen_the_posts_navigation(); } else { // If no content, include the "No posts found" template. get_template_part( 'template-parts/content/content', 'none' ); } ?> </main><!-- .site-main --> </div><!-- .content-area --> <?php get_footer();
– where is the have_posts defined? how does PHP know about it? I don’t see any imports or require statements?
– where is the WP engine loaded? I am specifically trying to understand when someone makes a request for index.php, as far as web server is concerned, its a request for a PHP resource. How does the wordpress engine/platform kick-in?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Where is have_posts defined?’ is closed to new replies.