I am using tag.php to display content when a user visits a tag page. Everything I need is working great, however it is only showing the most recent 6 posts that have the tag. I need it to list all posts with the tag.
When I change the "Blog pages show at most" under Reading to a large number, it breaks part of my site so I would like to do it in the tag.php code.
I know you can list all posts by using the 'posts_per_page' => -1 parameter, but am having trouble implementing that into my code.
This is in my tag.php file
<?php
if ( have_posts() ) : ?>
<?php $term_id = get_queried_object_id(); ?>
<div class="pantry-thumbnail"><?php the_term_thumbnail( $term_id, $size = 'post-thumbnail', $attr = '' ) ?></div>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
<strong>Recipes</strong>
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
?>
<ul>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
</ul>
<?
endwhile;
else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
wp_reset_query();
?>
Thank you for any help!