Codex

Function Reference/the post

Contents

Description

Iterate the post index in The Loop. Retrieves the next post, sets up the post, sets the 'in the loop' property to true.

Usage

<?php the_post(); ?>

Parameters

This function does not accept any parameters.

Return Values

This function does not return any values.

Examples

<?php
while ( have_posts() ) : the_post();
	echo '<h2>';
	the_title();
	echo '</h2>';
	the_content();
endwhile;
?>

Notes

Change Log

Source File

the_post() is located in wp-includes/query.php.

Related

See also index of Function Reference and index of Template Tags.