首页 > 解决方案 > get_the_post_thumbnail_url fullsize d它不起作用

问题描述

下面的函数应该调用全尺寸图像,但它没有。

<?php echo get_the_post_thumbnail_url($next_id, 'fullsize'); ?>

怎么可能强求?

它在放大器中不起作用,但在没有放大器中起作用。

我正在使用的完整代码。

<?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 }} ?>

感谢

标签: wordpress

解决方案


他们这里的关键字是 'full' 而不是 'fullsize' 正确的代码是

<?php echo get_the_post_thumbnail_url($next_id, 'full'); ?>

参考 https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/#source


推荐阅读