The loop...
while ( have_posts() ) : the_post();
// ...
endwhile;
the_post()
wp-includes/query.php, line 784
function the_post() {
global $wp_query;
$wp_query->the_post();
}
$wp_query->the_post()
wp-includes/query.php, line 2815
class WP_Query {
// ...
function the_post() {
global $post;
$this->in_the_loop = true;
if ( $this->current_post == -1 ) // loop has just started
do_action_ref_array('loop_start', array(&$this));
$post = $this->next_post();
setup_postdata($post);
}
setup_postdata()
wp-includes/query.php, line 3589
function setup_postdata($post) {
global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
$id = (int) $post->ID;
$authordata = get_userdata($post->post_author);
$currentday = mysql2date('d.m.y', $post->post_date, false);
$currentmonth = mysql2date('m', $post->post_date, false);
$numpages = 1;
$page = get_query_var('page');
if ( !$page )
$page = 1;
if ( is_single() || is_page() || is_feed() )
$more = 1;
$content = $post->post_content;
if ( strpos( $content, '' ) ) {
if ( $page > 1 )
$more = 1;
$multipage = 1;
$content = str_replace("\n\n", '', $content);
$content = str_replace("\n", '', $content);
$content = str_replace("\n", '', $content);
$pages = explode('', $content);
$numpages = count($pages);
} else {
$pages = array( $post->post_content );
$multipage = 0;
}
do_action_ref_array('the_post', array(&$post));
return true;
}