the_post()

Iterate the post index in the loop.


Description #


Source #

File: wp-includes/query.php

function the_post() {
	global $wp_query;
	$wp_query->the_post();
}


Top ↑

Changelog #

Changelog
Version Description
1.5.0 Introduced.

Top ↑

More Information #

Basic Usage

if ( have_posts() ) {
	while ( have_posts() ) {

		the_post(); ?>

		<h2><?php the_title(); ?></h2>

		<?php the_content(); ?>

	<?php }
}


Top ↑

User Contributed Notes #

You must log in before being able to contribute a note.