0
即时通讯使用下面的代码来回显我的图像缩略图URL到WordPress的自定义管理界面。WordPress的缩略图URL
<?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指向本地文件,并且明显心不是什么进出口寻找这工作得很好。
检查您的管理员,如果您的网站网址以“http://”开头,或者尝试使用site_url()' – DFayet
它确实从http:// –
开始您最近是否将您的网站从本地开发环境到在线环境? – mdarmanin