-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-listing-grid-v7-fullwidth-2cols.php
98 lines (79 loc) · 3.01 KB
/
template-listing-grid-v7-fullwidth-2cols.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* Template Name: Template listings grid v7 full width 2Cols
*/
get_header();
global $post, $listings_tabs, $total_listing_found;
$page_content_position = houzez_get_listing_data('listing_page_content_area');
$listing_args = array(
'post_type' => 'property',
'post_status' => 'publish'
);
$listing_args = apply_filters( 'houzez20_property_filter', $listing_args );
$listing_args = houzez_prop_sort ( $listing_args );
$listings_query = new WP_Query( $listing_args );
$total_listing_found = $listings_query->found_posts;
$listings_tabs = get_post_meta( $post->ID, 'fave_listings_tabs', true );
$mb = '';
if( $listings_tabs != 'enable' ) {
$mb = 'mb-2';
}
?>
<section class="listing-wrap listing-v7">
<div class="container">
<div class="page-title-wrap">
<?php get_template_part('template-parts/listing/listing-page-title'); ?>
</div><!-- page-title-wrap -->
<div class="row">
<div class="col-lg-12 col-md-12">
<?php
if ( $page_content_position !== '1' ) {
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
?>
<article <?php post_class(); ?>>
<?php the_content(); ?>
</article>
<?php
}
}
}?>
<div class="listing-tools-wrap">
<div class="d-flex align-items-center <?php echo esc_attr($mb); ?>">
<?php get_template_part('template-parts/listing/listing-tabs'); ?>
<?php get_template_part('template-parts/listing/listing-sort-by'); ?>
</div><!-- d-flex -->
</div><!-- listing-tools-wrap -->
<div class="listing-view grid-view card-deck grid-view-2-cols">
<?php
if ( $listings_query->have_posts() ) :
while ( $listings_query->have_posts() ) : $listings_query->the_post();
get_template_part('template-parts/listing/item', 'v7');
endwhile;
wp_reset_postdata();
else:
get_template_part('template-parts/listing/item', 'none');
endif;
?>
</div><!-- listing-view -->
<?php houzez_pagination( $listings_query->max_num_pages ); ?>
</div><!-- col-lg-12 col-md-12 -->
</div><!-- row -->
</div><!-- container -->
</section><!-- listing-wrap -->
<?php
if ('1' === $page_content_position ) {
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
?>
<section class="content-wrap">
<?php the_content(); ?>
</section>
<?php
}
}
}
?>
<?php get_footer(); ?>