Archived topic
{{custom_field._thumbnail_id}} only showing size-medium image, need full image
3 replies · Started by William on April 30, 2019
Viewing posts 1–4 of 4
Have a Header element, as a page hero. Using this code, it is only outputting the size-medium image, we need the full size image please.
<h1>{{post_title}}</h1>
{{custom_field._thumbnail_id}}
Results in (I've removed the domain from the paths):
<div class="page-hero">
<div class="inside-page-hero">
<h1>About Us</h1>
<img src="/wp-content/uploads/2019/04/about-us_hero-300x100.jpg" class="attachment-medium size-medium" alt="About Us" srcset="/wp-content/uploads/2019/04/about-us_hero-300x100.jpg 300w, /wp-content/uploads/2019/04/about-us_hero-768x256.jpg 768w, /wp-content/uploads/2019/04/about-us_hero-1024x341.jpg 1024w, /wp-content/uploads/2019/04/about-us_hero.jpg 1440w" sizes="(max-width: 300px) 100vw, 300px" width="300" height="100">
</div>
</div>
Hi there,
It displays the medium size by default.
You can change it using this filter:
add_filter( 'generate_hero_thumbnail_id_size', function() {
return 'full';
} );
Perfect, thank you very much!
You're welcome :)
This archived topic is closed to new replies.