Site icon Hip-Hop Website Design and Development

Can I use WP blocks in a template?

I’m not exactly sure how to explain this, but I have a slider I built using ACF that I placed on my home page. After this code, I want to use a WP block I built, and after that I want to put another slider. So it would look like this:

        <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>

Is there a way to do something like this? Put WP blocks between code in a template?