我有两个代码博客,我想让它看起来像这样:
如何使代码博客缺少alt文本和宽度高度值,删除url和wordpress url
示例:
<img class="alignnone" title="Women" src="https://3.bp.blogspot.com/-cR_7KLccvBM/WJ7h-yanzRI/AAAAAAAA6ps/hIk6C6Ha0eQzwIUaFpgYEkA6sY1bheTnwCLcB/s1600/women.jpg" alt="beatiful women" width="650" height="350"
<meta itemprop="url" content="<?php if (function_exists('catch_that_image')) {echo catch_that_image(); }?>" />
发布于 2017-02-17 15:32:20
如果你想像样例一样显示你的图片,那么wordpress有两个函数可以使用:
如果你想跳出这个圈子,
wp_get_attachment_image(get_post_thumbnail_id( $post->ID), 'thumbnail');
在循环内部
if ( has_post_thumbnail( 'thumbnail' ) ) {
the_post_thumbnail();
}
这将直接创建为您的示例代码。希望这对你有用
谢谢
https://stackoverflow.com/questions/42290396
复制相似问题