-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-listing-list-v1.php
113 lines (91 loc) · 3.45 KB
/
template-listing-list-v1.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
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Template Name: Template listings list v1
* Created by PhpStorm.
* User: waqasriaz
* Date: 16/12/15
* Time: 3:27 PM
*/
get_header();
global $post, $listings_tabs, $total_listing_found;
$page_content_position = houzez_get_listing_data('listing_page_content_area');
$is_sticky = '';
$sticky_sidebar = houzez_option('sticky_sidebar');
if( $sticky_sidebar['property_listings'] != 0 ) {
$is_sticky = 'houzez_sticky';
}
$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-v1">
<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-8 col-md-12 bt-content-wrap <?php echo houzez_option('template_sidebar_pos', ''); ?>">
<?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 list-view card-deck">
<?php
if ( $listings_query->have_posts() ) :
while ( $listings_query->have_posts() ) : $listings_query->the_post();
get_template_part('template-parts/listing/item', 'v1');
endwhile;
else:
get_template_part('template-parts/listing/item', 'none');
endif;
wp_reset_postdata();
?>
</div><!-- listing-view -->
<?php houzez_pagination( $listings_query->max_num_pages ); ?>
</div><!-- bt-content-wrap -->
<div class="col-lg-4 col-md-12 bt-sidebar-wrap <?php echo esc_attr($is_sticky); ?>">
<?php get_sidebar('property'); ?>
</div><!-- bt-sidebar-wrap -->
</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(); ?>