Support » Fixing WordPress » The Loop doesn't display all pages.

  • Resolved horkyze

    (@horkyze)


    Here is the code I run at page.php.
    I have more than 30 pages created, but this loop displays only 9 of them. What’s wrong?

    // The Query
    			$the_query = new WP_Query( array( 'post_type' => 'page') );
    
    			// The Loop
    			while ( $the_query->have_posts() ) : $the_query->the_post();
    				echo '<li>';
    				the_title();
    				echo '</li>';
    			endwhile;
    
    			// Reset Post Data
    			wp_reset_postdata();
Viewing 2 replies - 1 through 2 (of 2 total)
  • Settings => Reading

    Blog pages show at most, is that set to 9?

    Thread Starter horkyze

    (@horkyze)

    Ouuu yes! You were right. What a stupid trick 😀
    I was almost decided to hardcode it my-self using SQL, but now it’s great. Thank you. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The Loop doesn't display all pages.’ is closed to new replies.