我让类“ ms-thumb-frame-selected”获得了经验,并将其添加到后台
但是这里我的问题是所有“ ms-拇指框架”类都得到相同的图像
但是如果从检查错误中检查,我会看到其他图像正确
这里是我的代码
<?php
$loop = new WP_Query( 'posts_per_page=6&cat=');
while($loop->have_posts()) : $loop->the_post();
$bg= 0;
$slider_image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '');
?>
<?php
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if($bg == 0){ ?>
<style>
#masterslider .ms-thumb-frame-selected
{
background:linear-gradient( rgba(0, 0, 0, .8), rgba(0, 0, 0, .8)), url("<?php echo $url;?>") no-repeat ;
background-size:cover;
opacity: .8;
background-position: 100 0;
transition: background .5s;
}
</style>
在这里测试问题
那么在这里简短我的问题
寻找问题的滑块后,文本背景下的所有图像都是相同的,但是如果从检查错误中检查代码,则会得到其他图像
那怎么办?