[Resolved] {{custom_field._thumbnail_id}} only showing size-medium image, need full image

Home Forums Support {{custom_field._thumbnail_id}} only showing size-medium image, need full image

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #884417
    William

    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>
    #884572
    Tom
    Lead Developer
    Lead Developer

    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';
    } );
    #884610
    William

    Perfect, thank you very much!

    #884835
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.