我正在处理108.179.217.161这是一个自定义WordPress主题,我在主页上有一个滑块设置。但是,在每个单独的页面上,我想使用精选图像作为实际的主图像,并在主页上使用旋转器。WordPress主题不能正确显示图像
我正在使用一个小部件的旋转器和if语句来区分页面是否不是主页,但图像不能正确呈现。见108.179.217.161/contact-us/。
下面是我的代码:
<div id="slider" style="position:relative;height:679px;width:100%;">
<!--<img width=1228 src="<?php bloginfo(template_url)?>/images/room-slider.png" alt="" style="position:absolute;z-index:-20;width:100%;height:679px;"/>-->
<div style="position:absolute;z-index:-20;width:100%;height:679px;overflow:hidden;">
<?php if (is_page('Home')) {?>
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Rotator')) : ?>
[ do default stuff if no widgets ]
<?php endif; ?>
<? } else {
$thumb = get_post_meta($post->ID,'_thumbnail_id',false);
$thumb = wp_get_attachment_image_src($thumb[0], 'header', false);
$thumb = $thumb[0];
echo "<img src='$thumb' alt='' style='position:relative;z-index:1;width:1621px;height:679px;'";
}?>
</div>