-
Notifications
You must be signed in to change notification settings - Fork 0
/
clients.php
114 lines (73 loc) · 1.84 KB
/
clients.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
<?php
/**
* Template name:Clients
*/
get_header();?>
<div id="blog" class="blog-home container hover-section">
<div class="category-head">
<h4><?php the_title();?></h4>
<div class="bars-animation">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/hicon.png" alt="PM">
</div>
</div>
<div class="row">
<div class="col-sm-12">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
the_content();
// End of the loop.
endwhile;
?>
</div>
</div>
<div id="clients">
<?php
$posts = new WP_Query( array(
'posts_per_page' => -1,
'post_type' => 'clients',
'orderby' => 'last_name',
'order' => 'ASC',
) );
global $post;
$index = 0;
$max_per_row = 3; // 0 indexed
if ( $posts->have_posts() ) :
while ( $posts->have_posts() ) : $posts->the_post();
if ( $index == 0 ) : ?>
<div class="row">
<?php endif; ?>
<div class="col-xs-12 col-sm-3">
<div class="trd-testimonial-text">
<?php if ( $website_url = get_post_meta(get_the_ID(), 'wpcf-link', true) ) : ?>
<a href="<?php echo get_post_meta(get_the_ID(), 'wpcf-link', true);?>" target="_blank">
<?php endif; ?>
<h3>
<?php echo $post->post_title;?>
</h3>
<?php if ( $website_url ) : ?>
</a>
<?php endif; ?>
</div>
</div>
<?php
if ( $index == $max_per_row ) : ?>
</div>
<?php
$index = 0;
else :
$index++;
endif;
endwhile;
wp_reset_postdata();
// Ensure that the row closes out
if ( $index < $max_per_row &&
$index > 0 ) : ?>
</div>
<?php endif;
endif; ?>
</div>
</div>
</div>
<?php get_footer();?>