1. Home
  2. Docs
  3. Page (page-[category].php)
  4. Features Section
  5. Features scripts

Features scripts

<?php 
                                if(!empty(get_field('features_icon_1')) & 
                                    !empty(get_field('features_title_1')) & 
                                    !empty(get_field('features_desc_1'))):
                              ?>
                              <div class="carousel-item col-lg-3 text-center center">
                                <div class="col row">
                                          <div class="card mb-4 same-box-height">
                                                    <?php
                                             $image = get_field('features_icon_1');

                                            if( !empty($image) ): ?>

                                            <img class="" src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('features_icon_1')) ?>">

                                            <?php endif; ?>
                                                    
                                                    <div class="card-body">
                                                      <h5 class="text-center"><?php echo get_field('features_title_1');?> </h5>
                                                      <p class="card-text text-center"><?php echo get_field('features_desc_1');?></p>
                                                     
                                                    </div>
                                          
                                          </div>
                                </div>
                              </div>
                              <?php endif;?>


                              <?php 
                                if(!empty(get_field('features_icon_2')) & 
                                    !empty(get_field('features_title_2')) & 
                                    !empty(get_field('features_desc_2'))):
                              ?>
                              <div class="carousel-item col-lg-3 text-center center">
                                <div class="col row">
                                          <div class="card mb-4 same-box-height">
                                                    <?php
                                             $image = get_field('features_icon_2');

                                            if( !empty($image) ): ?>

                                            <img class="" src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('features_icon_2')) ?>">

                                            <?php endif; ?>
                                                    
                                                    <div class="card-body">
                                                      <h5 class="text-center"><?php echo get_field('features_title_2');?> </h5>
                                                      <p class="card-text text-center"><?php echo get_field('features_desc_2');?></p>
                                                     
                                                    </div>
                                          
                                          </div>
                                </div>
                              </div>
                              <?php endif;?>

                              <?php 
                                if(!empty(get_field('features_icon_3')) & 
                                    !empty(get_field('features_title_3')) & 
                                    !empty(get_field('features_desc_3'))):
                              ?>
                              <div class="carousel-item col-lg-3 text-center center">
                                <div class="col row">
                                          <div class="card mb-4 same-box-height">
                                                    <?php
                                             $image = get_field('features_icon_3');

                                            if( !empty($image) ): ?>

                                            <img class="" src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('features_icon_3')) ?>">

                                            <?php endif; ?>
                                                    
                                                    <div class="card-body">
                                                      <h5 class="text-center"><?php echo get_field('features_title_3');?> </h5>
                                                      <p class="card-text text-center"><?php echo get_field('features_desc_3');?></p>
                                                     
                                                    </div>
                                          
                                          </div>
                                </div>
                              </div>
                              <?php endif;?>

                              <?php 
                                if(!empty(get_field('features_icon_4')) & 
                                    !empty(get_field('features_title_4')) & 
                                    !empty(get_field('features_desc_4'))):
                              ?>
                              <div class="carousel-item col-lg-3 text-center center">
                                <div class="col row">
                                          <div class="card mb-4 same-box-height">
                                                    <?php
                                             $image = get_field('features_icon_4');

                                            if( !empty($image) ): ?>

                                            <img class="" src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('features_icon_4')) ?>">

                                            <?php endif; ?>
                                                    
                                                    <div class="card-body">
                                                      <h5 class="text-center"><?php echo get_field('features_title_4');?> </h5>
                                                      <p class="card-text text-center"><?php echo get_field('features_desc_4');?></p>
                                                     
                                                    </div>
                                          
                                          </div>
                                </div>
                              </div>
                              <?php endif;?>

                              <?php 
                                if(!empty(get_field('features_icon_5')) & 
                                    !empty(get_field('features_title_5')) & 
                                    !empty(get_field('features_desc_5'))):
                              ?>
                              <div class="carousel-item col-lg-3 text-center center">
                                <div class="col row">
                                          <div class="card mb-4 same-box-height">
                                                    <?php
                                             $image = get_field('features_icon_5');

                                            if( !empty($image) ): ?>

                                            <img class="" src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('features_icon_5')) ?>">

                                            <?php endif; ?>
                                                    
                                                    <div class="card-body">
                                                      <h5 class="text-center"><?php echo get_field('features_title_5');?> </h5>
                                                      <p class="card-text text-center"><?php echo get_field('features_desc_5');?></p>
                                                     
                                                    </div>
                                          
                                          </div>
                                </div>
                              </div>
                              <?php endif;?>

                              <?php 
                                if(!empty(get_field('features_icon_6')) & 
                                    !empty(get_field('features_title_6')) & 
                                    !empty(get_field('features_desc_6'))):
                              ?>
                              <div class="carousel-item col-lg-3 text-center center">
                                <div class="col row">
                                          <div class="card mb-4 same-box-height">
                                                    <?php
                                             $image = get_field('features_icon_6');

                                            if( !empty($image) ): ?>

                                            <img class="" src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('features_icon_6')) ?>">

                                            <?php endif; ?>
                                                    
                                                    <div class="card-body">
                                                      <h5 class="text-center"><?php echo get_field('features_title_6');?> </h5>
                                                      <p class="card-text text-center"><?php echo get_field('features_desc_6');?></p>
                                                     
                                                    </div>
                                          
                                          </div>
                                </div>
                              </div>
                              <?php endif;?>

description:

Display the Features section for each page, we set max 6 features to display

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *