自定义帖子类型的引导程序4,滑块(轮播)中带有两列

时间:2018-08-05 05:55:57

标签: wordpress twitter-bootstrap

我尝试在Bootstrap 4(轮播中的两列)中获取自定义帖子类型的任何方法,但我在Bootstrap轮播中如何获取两列的问题,但是问题是,在(以下)自定义帖子类型代码之后,我没有得到任何内容使用过:

<div class="testimonials">
<div class="main-wrapper">
    <div class="container">
        <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" data-interval="0">
             <div class="carousel-inner">
                 <?php 


            $Slider=query_posts('post_type=wpm-testimonial  && posts_per_page=6 && order=asc');

            $tP = count($Slider);

      $j =1;


      ?>

                 <div class="carousel-item tough active ">
        <div class="row">
        <?php while (have_posts() ) : the_post();  ?>
     <div class="col-lg-6">
        <h1><?php the_content(); ?></h1>
        <h2><?php the_title(); ?></h2>
    </div>

             <?php
      if($j % 2 === 0) {
          echo '</div> </div>';
          if($j < $tP){ echo '<div class="carousel-item tough "><div class="row">';}
      }
        $j++;
         endwhile; ?>




    </div>

</div>  

                 <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
                 <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
              </div>
        </div>
    </div>
</div>

在此之下,我使用了画廊插件的简码,而在画廊下面,我使用了ACF自定义字段组,这些字段未显示.....自定义帖子类型引导轮播之后……

1 个答案:

答案 0 :(得分:0)

好像您最后缺少一个</div>

<div class="testimonials">
    <div class="main-wrapper">
        <div class="container">
            <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" data-interval="0">
                <div class="carousel-inner">
                                <?php 


                            $Slider=query_posts('post_type=wpm-testimonial  && posts_per_page=6 && order=asc');

                            $tP = count($Slider);

                    $j =1;


                    ?>

                                <div class="carousel-item tough active ">
                        <div class="row">
                        <?php while (have_posts() ) : the_post();  ?>
                    <div class="col-lg-6">
                        <h1><?php the_content(); ?></h1>
                        <h2><?php the_title(); ?></h2>
                    </div>

                            <?php
                    if($j % 2 === 0) {
                        echo '</div> </div>';
                        if($j < $tP){ echo '<div class="carousel-item tough "><div class="row">';}
                    }
                        $j++;
                        endwhile; ?>




                    </div>

                </div>  

                    <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                    </a>
                                <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
                </div>
            </div>
        </div>
    </div>
</div>