Y
Y
YakovSpb2020-05-17 18:27:04
WordPress
YakovSpb, 2020-05-17 18:27:04

How to slider ACF repeater with chapter call on another page?

Here is the code to be output. Will it be visible on another page? or ACF only these fields are visible on the cupola?
If yes, then how to display the code using shortcode?

//Add short code slider
function home_slider(){
return "Тут должна быть секция слайдера";
}
add_shortcode('home_slider', 'home_slider');


<div class="sect-clients">
      <div class="container">


        <?php if( have_rows('slider_home_clients') ): ?>
          <div class="clients-slider">
            <?php while( have_rows('slider_home_clients') ): the_row(); 

              $yak_image_klient = get_sub_field('kartinka_slajda_klientov');
              $yak_imageurl_klientov = $yak_image_klient ['sizes']['medium'];
              ?>
              <div class="clients-slide"><img src="<?php echo $yak_imageurl_klientov; ?>" alt="alt"></div>
            <?php endwhile; ?>
          </div>
        </div>
      <?php endif; ?>
      <div class="clients__arrows">
        <div class="container">
          <div class="c_prevArrow c_arrow"><i class="fa fa-angle-left"></i></div>
          <div class="c_nextArrow c_arrow"><i class="fa fa-angle-right"></i></div>		
        </div>
      </div>
    </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-05-17
@YakovSpb

Give the have_rows function a second parameter with the id of the master page. Then the slider will be displayed on all pages.
have_rows()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question