load all content on 1 page
i am creating a gallery with all images to be displayed on 1 page itself however only about 10 images of the latest uploaded are displayed...how do i get all of them to be displayed below is my code
<?php get_header(); ?>
<article>
<?php while (have_posts()) : the_post(); ?>
<div class="index">
<div class="thumb"><?php the_post_thumbnail('')?> </div>
</div>
<?php endwhile; ?>
</article>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Solutions
The basic WordPress setup only calls out the last 10. You'll need to make your own query to be able to run more posts through.
Try this out:
<?php get_header(); ?>
<article>
<?php
$query = new WP_Query( 'posts_per_page=-1' );
while ($query->have_posts()) : $query->the_post();
?>
<div class="index">
<div class="thumb"><?php the_post_thumbnail('')?> </div>
</div>
<?php endwhile; ?>
</article>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
The full explanation can be found in the codex.
Details about the usage above can be found HERE
the problem is you are running this with Standard WordPress Loop . Normally the standard WordPress Loop is bounded to ten. This you can change in Settings -> Reading -> Blog pages show at most
but if you don't want to change it there you need to put this before the loop
wp_reset_query();
query_posts( 'posts_per_page=10000' ); // will proably show 10000 now as seen in the other answers -1 should show all
which starts with
<?php while (have_posts()) : the_post(); ?>
http://codex.wordpress.org/Function_Reference/query_posts https://codex.wordpress.org/Function_Reference/wp_reset_query
so far so good?