-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-directory.php
122 lines (107 loc) · 5.18 KB
/
page-directory.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
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/*
Template Name: Directory Page
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
/* Flexible Content */
include get_theme_file_path('/inc/flexible-content.php');
?>
<?php
/*
███████ ███████ █████ ██████ ██████ ██ ██ ██ ███████ ██ ██ ████████ ███████ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ █████ ███████ ██████ ██ ███████ ████████ █████ ██ ██ ██ █████ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ███████ ██ ██ ██ ██ ██████ ██ ██ ██████ ██ ██ ███████ ██ ███████ ██ ██
*/
?>
<div class="container-fluid">
<div class="container">
<div>
<?php echo do_shortcode( '[searchandfilter id="91"]' ) ?>
</div>
</div>
</div>
<div class="container-fluid">
<div class="container">
<div class="row row-cols-md-2 row-cols-lg-3 g-5 d-flex justify-content-center">
<?php
$args = array('post_type' => 'store', 'paged' => get_query_var('paged') ? get_query_var('paged') : 1);
$args['search_filter_id'] = 91;
$stores = new WP_Query($args);
if ($stores->have_posts()) {
while ($stores->have_posts()) {
$stores->the_post();
?>
<div class="col">
<div class="m-3 ">
<div class="card-header-custom text-center text-white pt-3 fosforos d-flex justify-content-center align-items-center">
<h3><?php the_title(); ?></h3>
</div>
<div class="card-body-custom text-center py-5 px-5">
<?php if (has_post_thumbnail()) : ?>
<div class="featured-image pb-5">
<?php the_post_thumbnail('4-3r320', ['class' => 'img-fluid thumb-cool']); ?>
</div>
<?php else : ?>
<div class="featured-image pb-5">
<img src="https://via.placeholder.com/320x240" alt="Placeholder Image" class="img-fluid">
</div>
<?php endif; ?>
<div class="text-start pb-5">
<?php
if ( get_the_content() ) {
echo get_excerpt(102, 'content');
} else {
echo 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua';
}
?>
</div>
<div class="w-100">
<a class="btn btn-dark" href="<?php echo esc_url( get_permalink() ); ?>">
LEARN MORE
</a>
</div>
</div>
</div>
</div>
<?php
}
wp_reset_postdata();
} else {
echo '<p>No stores found.</p>';
}
?>
</div>
</div>
</div>
<!-- Pagination -->
<div class="container-fluid">
<div class="container my-5 py-5">
<div class="pagination d-flex justify-content-center">
<?php
echo paginate_links(array(
'total' => $stores->max_num_pages,
'current' => max(1, get_query_var('paged')),
'format' => '?paged=%#%',
'show_all' => false,
'type' => 'plain',
'end_size' => 2,
'mid_size' => 2,
'prev_next' => true,
'prev_text' => __('<i class="fas fa-chevron-left"></i>'),
'next_text' => __('<i class="fas fa-chevron-right"></i>'),
'add_args' => false,
'add_fragment' => '',
));
?>
</div>
</div>
</div>
</article>
<?php endwhile; endif; ?>
<?php get_footer(); ?>