Why am I being limited to ten posts on a custom loop?

Because it must be set in back end of your wordpress site.
You can check and change it from Blog pages show at most field from settings => Reading pages menu. As shown in below screenshot.

Blog pages show at most

It will change the setting for all pages , but if you want to make this change only for tag page then in your case you can change the code in loop-tag.php file as following :

global $wp;
$s_array = array( 'posts_per_page' => -1 );  // Change to how many posts you want to display 
$new_query = array_merge( $s_array, (array) $wp->query_vars );

// The Query
$the_query = new WP_Query( $new_query );

// The Loop
if ( $the_query->have_posts() ) {

    while ( $the_query->have_posts() ) {
        $the_query->the_post();
         ?>
        <!-- Here I grab the image from the post with that tag --> 
        <?php
    }

    /* Restore original Post Data */
    wp_reset_postdata();
}

You can also use pre_get_posts action hook to change post limit.

Leave a Comment