Reputation: 3
The following function should call the full-size image, but it doesn't.
<?php echo get_the_post_thumbnail_url($next_id, 'fullsize'); ?>
How could it be forced?
It does not work in amp but it does in no amp.
Complete code that I am using.
<?php if(has_post_thumbnail()) {?> <?php if(is_amp_endpoint()) { ?>
<amp-img class="amp-wp-enforced-sizes" src="<?php echo get_the_post_thumbnail_url($nextID, 'full'); ?>" width="372" height="186" alt="<?php echo esc_attr($post->post_title); ?>" layout="responsive" >
<noscript><img decoding="async" alt="AMP" src="<?php echo get_the_post_thumbnail_url($next_id, 'full'); ?>"></noscript>
</amp-img>
<?php } else {?>
<?php echo get_the_post_thumbnail($next->ID, 'fullsize'); ?>
<?php }} ?>
Thank
Upvotes: 0
Views: 191
Reputation: 11
They keyword here is 'full' not 'fullsize' Correct code is
<?php echo get_the_post_thumbnail_url($next_id, 'full'); ?>
Reference https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/#source
Upvotes: 1