HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //var/www/html/qcr24/quantum/wp-content/themes/quantum/Page-Templates/template-rental.php
<?php
/*
Template Name: Rental
*/
get_header();
?>

    <main id="main">
        <section></section>
        <!-- ======= Rental Cars Section ======= -->
        <section class="pb-0">
            <div class="container" data-aos="fade-up">
                <div class="section-title">
                    <h2 class="title-text">Our Cars for Rental</h2>
                </div>

                <?php
                    $terms = get_terms(array(
                        'taxonomy' => 'rent_cat',
                        'orderby'  => 'id',
                        'order'    => 'ASC',
                        'hide_empty' => false,
                    ));

                    foreach($terms as $term){
                ?>

                        <div class="cars-brand">
                            <h4><?php echo $term->name; ?></h4>
                        </div>

                        <div class="rental-car-slider swiper" data-aos="fade-up" data-aos-delay="100">
                            <div class="swiper-wrapper">

                                <?php
                                    $args = new WP_Query( array(
                                        'post_type' => 'rent',
                                        'tax_query' => array(
                                            array (
                                                'taxonomy' => 'rent_cat',
                                                'field' => 'slug',
                                                'terms' => $term->slug,
                                            )
                                        ),
                                    ) );

                                    if ( $args->have_posts() ) { 

                                        while ( $args->have_posts() ) : $args->the_post();

                                        $image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
                                ?>

                                            <div class="swiper-slide">
                                                <div class="car-box">
                                                    <div class="image-box">
                                                        <img src="<?php echo $image_url[0]; ?>">
                                                        <div class="overlay">
                                                            <img src="<?php echo get_field('hover_image'); ?>">
                                                        </div>
                                                    </div>
                                                    <div class="car-box-desc">
                                                        <h5><span>Rent</span> <span><?php echo get_field('rent_amount'); ?></span></h5>
                                                    </div>
                                                </div>
                                            </div>   

                                <?php
                                        endwhile;
                                    }

                                    wp_reset_query();
                                ?>

                            </div>
                            <div class="swiper-button-prev"></div>
                            <div class="swiper-button-next"></div>
                            <div class="swiper-pagination"></div>
                        </div>

                <?php } ?>

            </div>
        </section>
        <!-- End Rental cars Section -->
    </main>
    <!-- End #main -->

<?php
get_footer();
?>