wordpress - 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 }} ?>
感谢
解决方案
他们这里的关键字是 'full' 而不是 'fullsize' 正确的代码是
<?php echo get_the_post_thumbnail_url($next_id, 'full'); ?>
参考 https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/#source
推荐阅读
- spring - InvalidDataAccessResourceUsageException:无法提取 ResultSet;SQL [不适用];
- jquery - 试图在聊天框中输出用户名......我如何使用 jQuery 来做到这一点?
- typescript - CucumberJs - Protractor - TypeScript - .feature 文件上的动态标签/变量
- javascript - Firebase 上的 Nuxt 动态路由
- homebrew - Homebrew:在任何地方解压并安装公式:错误:您的用户无法写入以下目录
- php - PHP cURL 错误:错误:14077410:SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报握手失败
- javascript - 如何使用javascript进行计算加减
- protractor - 有没有办法将 protractor.conf 套件名称读入 txt 文件?
- python - 多次在服务器端运行代码并在 html 渲染上使用结果
- python - 在列表中查找与给定数字最接近的位置