Uses
Uses | Description |
---|---|
wp-includes/class-wp-query.php: WP_Query::the_post() | Sets up the current post. |
Iterate the post index in the loop.
Basic Usage
if ( have_posts() ) { while ( have_posts() ) { the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php } }
File: wp-includes/query.php
function the_post() { global $wp_query; $wp_query->the_post(); }
Version | Description |
---|---|
1.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/the_post