rewind_posts example

return true;
        } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
            /** * Fires once the loop has ended. * * @since 2.0.0 * * @param WP_Query $query The WP_Query instance (passed by reference). */
            do_action_ref_array( 'loop_end', array( &$this ) );
            // Do some cleaning up after the loop.             $this->rewind_posts();
        } elseif ( 0 === $this->post_count ) {
            $this->before_loop = false;

            /** * Fires if no results are found in a post query. * * @since 4.9.0 * * @param WP_Query $query The WP_Query instance. */
            do_action( 'loop_no_results', $this );
        }

function rewind_posts() {
    global $wp_query;

    if ( ! isset( $wp_query ) ) {
        return;
    }

    $wp_query->rewind_posts();
}

/** * Iterate the post index in the loop. * * @since 1.5.0 * * @global WP_Query $wp_query WordPress Query object. */
function the_post() {
    global $wp_query;

    
<?php         while ( have_posts() ) :
            the_post();
            ?> <rdf:li rdf:resource="<?php the_permalink_rss(); ?>"/> <?php endwhile; ?> </rdf:Seq> </items> </channel> <?php rewind_posts();
while ( have_posts() ) :
    the_post();
    ?> <item rdf:about="<?php the_permalink_rss(); ?>"> <title><?php the_title_rss(); ?></title> <link><?php the_permalink_rss(); ?></link> <dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator> <dc:date><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', $post->post_date_gmt, false ); ?></dc:date> <?php the_category_rss( 'rdf' ); ?>
Home | Imprint | This part of the site doesn't use cookies.