【发布时间】:2018-01-03 02:57:19
【问题描述】:
我会尝试将特色图片作为徽标后面的背景标题,但结果不是仅显示此字符串:
">
所以我认为代码有问题,但我不知道是什么。
这是我的代码:
<?php else: ?>
<div id="header-video">
<div id="video_bg" class="img_full_responsive" style="width:100%;background:url('<?php echo get_the_post_thumbnail($post_id, 'image-featured'); ?> ">
<?php include(TEMPLATEPATH."/template/header/header-logo.php"); ?>
</div>
</div>
<?php endif; ?>
【问题讨论】:
-
您使用的是子主题吗?
-
检查
$post_id对页面是否正确? -
您是否为“图片特色”使用自定义字段?如果您使用的是 WP 的默认特色图片,您应该使用“the_post_thumbnail_url”,更多信息在这里:codex.wordpress.org/Function_Reference/the_post_thumbnail_url