## templates – Display “large” image size in attachment page

Question

On the attachment page for an image, I’d like to display the image in its “large” size. The current behavior is showing the “medium” size image.

I’m using a theme I created from underscores.

The relevant part of the template file that outputs the image on the attachment page is (in template-parts/content.php):

the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);


… which is basically just sanitization of the_content().

What I see in the HTML in one example attachment page is:

<p class="attachment">
</a>
</p>


note the classes of “attachment-medium” and “size-medium” and the dimensions of my “medium” media size.

Where can I change the size displayed on attachment pages from “medium” to “large”? I can’t find a setting anywhere for this.

Also, in some older WordPress sites I’ve made, the default display was large, and they were also using the_content() to display the image. I”m not sure what’s different here.

WordPress 5.8.2

0
9 months 2021-11-20T21:22:39-05:00 0 Answers 0 views 0