Forums

changes to the loop 2.3 to 2.5.1? (4 posts)

  1. nomoregrapes
    Member
    Posted 4 years ago #

    Hi
    I was making a page seperate from my template that uses 'the loop' and was grabbing the titles of the last 5 or so posts(the default loop action).
    http://codex.wordpress.org/The_Loop

    Then I upgraded 2.3 to 2.5.1.

    Now my loop doesn't work, and as it gets no posts returns the alternative message "Sorry, no posts matched your criteria."
    Has something changed to the loop that isn't yet documented in the link above?

  2. MichaelH
    Volunteer
    Posted 4 years ago #

    You might want to paste your loop code at http://wordpress.pastebin.ca/ and report the link back here.

  3. nomoregrapes
    Member
    Posted 4 years ago #

    Just like the link I gave you...

    <?php define('WP_USE_THEMES', false); require('./wp-blog-header.php'); ?>
    
    <html><body>
    <!-- some of my page stuff... -->
    
    <!-- start latest blog post contents -->
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    	<?php endwhile; else: ?>
    	<p><?php _e('Sorry, unable to find the blog post.'); ?></p>
    	<?php endif; ?>			
    
    <!-- end latest blog post contents -->
    </body></html>
  4. nomoregrapes
    Member
    Posted 4 years ago #

    any reason why this shouldn't work?

Topic Closed

This topic has been closed to new replies.

About this Topic