私は高度なカスタムフィールドを使用して再利用可能なモジュールを構築し、柔軟なコンテンツを使用して視差モジュールを構築しています。詳細カスタムフィールド背景の競合
モジュールテンプレート
<style>
.parallax-bg {
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
.hero-child {
position: absolute;
width: 100%;
background-repeat: no-repeat;
background-size: cover;
z-index: 0;
height:100%;
background-image:url("<?php the_sub_field('parallax_image_sm'); ?>");
}
@media only screen and (min-width: 768px) {
.parallax-bg {
background-size: cover;
background-position: top center;
background-repeat: no-repeat;
position: relative;
}
.hero-child {
background-image:url("<?php the_sub_field('parallax_image_lrg'); ?>");
}
}
</style>
<section class="parallax-bg <?php the_sub_field('add_class'); ?>" style="overflow:hidden;">
<div class="hero-child" data-bottom-top="background-position:50% 100px;" data-top-bottom="background-position:50% -100px;"></div>
<div class="row">
<div class="parallax-content">
<?php the_sub_field('parallax_content'); ?>
</div><!!--end parallax content -->
</div>
</section>
私はページ上の同じモジュールを使用すると、同じ背景画像が同じセクションのために表示されます。私はこれを回避する方法を見つけようとしています。私はGUIDを使用することを考えていましたが、より単純なソリューションがあることを望んでいましたか?