File: //proc/thread-self/root/var/www/html/wpprotonperinggit/wp-content/themes/voiture/page-listings.php
<?php
/**
* The template for displaying pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other "pages" on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Voiture
* @since Voiture 1.0
*/
/*
*Template Name: Listings Template
*/
if ( isset( $_REQUEST['load_type'] ) && WP_CarDealer_Mixes::is_ajax_request() ) {
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
$query_args = array(
'post_type' => 'listing',
'post_status' => 'publish',
'post_per_page' => wp_cardealer_get_option('number_listings_per_page', 10),
'paged' => $paged,
);
$params = null;
if ( WP_CarDealer_Listing_Filter::has_filter() ) {
$params = $_GET;
}
$listings = WP_CarDealer_Query::get_posts($query_args, $params);
if ( 'items' !== $_REQUEST['load_type'] ) {
echo WP_CarDealer_Template_Loader::get_template_part('archive-listing-ajax-full', array('listings' => $listings));
} else {
echo WP_CarDealer_Template_Loader::get_template_part('archive-listing-ajax-listings', array('listings' => $listings));
}
} else {
get_header();
$layout_type = voiture_get_listings_layout_type();
$filter_sidebar = voiture_get_listings_filter_sidebar();
if ( $layout_type == 'half-map' ) {
$first_class = 'col-lg-5 col-md-6 col-xs-12 first_class';
$second_class = 'col-lg-7 col-md-6 col-xs-12 second_class';
$sidebar = 'listings-filter-half-map';
$sidebar_wrapper_class = 'listings-filter-sidebar-wrapper';
?>
<section id="main-container" class="inner layout-type-<?php echo esc_attr($layout_type); ?>">
<div class="mobile-groups-button hidden-lg hidden-md clearfix text-center">
<button class=" btn btn-sm btn-theme btn-view-map" type="button"><i class="fas fa-map pre" aria-hidden="true"></i> <?php esc_html_e( 'Map View', 'voiture' ); ?></button>
<button class=" btn btn-sm btn-theme btn-view-listing hidden-xs hidden-sm" type="button"><i class="fas fa-list pre" aria-hidden="true"></i> <?php esc_html_e( 'Listings View', 'voiture' ); ?></button>
</div>
<?php if( is_active_sidebar( $sidebar ) ) { ?>
<div class="<?php echo esc_attr($sidebar_wrapper_class); ?>">
<span class="close-filter"><i class="ti-close"></i></span>
<div class="inner">
<?php dynamic_sidebar( $sidebar ); ?>
</div>
</div>
<div class="over-dark-filter"></div>
<?php } ?>
<div class="row no-margin layout-type-<?php echo esc_attr($layout_type); ?>">
<div id="main-content" class="<?php echo esc_attr($first_class); ?>">
<div class="inner-left">
<div class="content-listing">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
the_content();
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
// End the loop.
endwhile;
?>
</div>
</div>
</div><!-- .content-area -->
<div class="<?php echo esc_attr($second_class); ?>">
<div id="listings-google-maps" class="fix-map hidden-xs hidden-sm"></div>
</div>
</div>
</section>
<?php
} else {
$sidebar_configs = voiture_get_listings_layout_configs();
?>
<section id="main-container" class="inner layout-type-<?php echo esc_attr($layout_type.' '.$filter_sidebar); ?> <?php echo ((voiture_get_listings_show_filter_top())?'has-filter-top':''); ?>">
<?php
$filter_top_sidebar = voiture_get_listings_filter_top_sidebar();
if ( is_active_sidebar( $filter_top_sidebar ) && voiture_get_listings_show_filter_top() ) { ?>
<div class="listings-filter-top-sidebar-wrapper filter-top-sidebar-wrapper">
<?php dynamic_sidebar( $filter_top_sidebar ); ?>
</div>
<?php } ?>
<?php if ( $layout_type == 'top-map' ) { ?>
<div class="mobile-groups-button hidden-lg hidden-md clearfix text-center">
<button class=" btn btn-sm btn-theme btn-view-map" type="button"><i class="fas fa-map pre" aria-hidden="true"></i> <?php esc_html_e( 'Map View', 'voiture' ); ?></button>
<button class=" btn btn-sm btn-theme btn-view-listing hidden-sm hidden-xs" type="button"><i class="fas fa-list pre" aria-hidden="true"></i> <?php esc_html_e( 'Listings View', 'voiture' ); ?></button>
</div>
<div id="listings-google-maps" class="hidden-sm hidden-xs top-map"></div>
<?php } ?>
<?php
voiture_render_breadcrumbs();
?>
<div class="main-content <?php echo apply_filters('voiture_page_content_class', 'container');?> inner">
<?php voiture_before_content( $sidebar_configs ); ?>
<div class="row">
<?php voiture_display_sidebar_left( $sidebar_configs ); ?>
<div id="main-content" class="col-sm-12 <?php echo esc_attr($sidebar_configs['main']['class']); ?>">
<main id="main" class="site-main layout-type-<?php echo esc_attr($layout_type); ?>" role="main">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
the_content();
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
// End the loop.
endwhile;
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php voiture_display_sidebar_right( $sidebar_configs ); ?>
</div>
</div>
</section>
<?php
}
get_footer();
}