Wordpress缩略图网址

时间:2015-09-14 13:34:53

标签: php wordpress

我使用以下代码将我的图片缩略图网址回显到wordpress中的自定义管理界面。

<?php 
if( has_post_thumbnail() ) {
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id,'full', true); ?>                                    

<img src="<?php echo($thumb_url[0]);?>"/>                                                               

<?php } else { ?>
<?php $url = site_url( '', 'http' ); ?>
<img src="<?php echo $url; ?>/wp-content/plugins/scp-bookings/custom/images/hotel-512.png" width="150" height="150" >
<?php } ?> 

然而,当我使用开发工具进行检查时,我可以看到URL如下。

//www.domain.com/pathtoimage

当我在浏览器中查看时,这工作正常,但当我在发出的电子邮件中查看此HTML时,URL指向本地文件,这显然不是我想要的。

1 个答案:

答案 0 :(得分:0)

发现它是什么。原来它是cloudflare CDN插件。

无论如何,谢谢你的帮助。