我不确定如何解释这一点,但我有一个使用ACF构建的滑块,我把它放在了主页上。在这段代码之后,我想使用我构建的WP块,然后我想放置另一个滑块。所以看起来是这样的:
<div class="col-lg-9 col-sm-12">
<div class="row slide-area">
<!-- // * Slider starts -->
<section class="slider_container_top_main">
<!-- all slides container starts -->
<ul class="slider_container_top">
<?php
// get slider data
if (have_rows(\'slider\')) :
while (have_rows(\'slider\')) : the_row();
$slider_image = get_sub_field(\'slider_image\');
$slider_headline = get_sub_field(\'slider_headline\');
?>
<!-- slide starts -->
<li>
<div class="slider_container_top_img_container">
<img src="<?php echo $slider_image[\'url\'] ?>" alt="slider image" class="slider_container_top_img"
loading="lazy">
<div class="row align-items-center justify-content-center top-navigation-div">
<div class="col-lg-9 offset-lg-3 col-sm-12 col-12 black-s top-navigation-controls"><?php echo $slider_headline; ?></div>
</div>
</div>
</li>
<!-- slide ends -->
<?php
endwhile;
endif;
?>
</ul>
<!-- all slides container ends -->
</section>
<!-- // * Slider ends -->
</div>
</div>
</div>
** WP block would go here **
// And here\'s another slider
<div class="col-lg-9 col-sm-12">
<div class="row slide-area">
<!-- // * Slider starts -->
<section class="slider_container_top_main">
<!-- all slides container starts -->
<ul class="slider_container_top">
<?php
// get slider data
if (have_rows(\'slider\')) :
while (have_rows(\'slider\')) : the_row();
$slider_image = get_sub_field(\'slider_image\');
$slider_headline = get_sub_field(\'slider_headline\');
?>
<!-- slide starts -->
<li>
<div class="slider_container_top_img_container">
<img src="<?php echo $slider_image[\'url\'] ?>" alt="slider image" class="slider_container_top_img"
loading="lazy">
<div class="row align-items-center justify-content-center top-navigation-div">
<div class="col-lg-9 offset-lg-3 col-sm-12 col-12 black-s top-navigation-controls"><?php echo $slider_headline; ?></div>
</div>
</div>
</li>
<!-- slide ends -->
<?php
endwhile;
endif;
?>
</ul>
<!-- all slides container ends -->
</section>
<!-- // * Slider ends -->
</div>
</div>
</div>
有没有办法做到这一点?在模板中的代码之间放置WP块?