-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtemplate_tab2.php
80 lines (71 loc) · 3.15 KB
/
template_tab2.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
<?php
/*
Template Name: Tab 2
*/
get_header(); ?>
<section class="tab_area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="tab_style_two">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<!--
<li class="active"><a href="#one2" role="tab" data-toggle="tab">Home2</a></li>
<li><a href="#two2" role="tab" data-toggle="tab">Profile2</a></li>
<li><a href="#three2" role="tab" data-toggle="tab">Messages2</a></li>
-->
<?php
$all_terms = get_terms(array(
'taxonomy' => 'filtering_category',
'hide_empty' => false
));
$x = 0;
foreach($all_terms as $single_term){
$active = '';
if($x == 0){
$active = 'active';
}
echo '<li class="'. $active .'"><a href="#'. $single_term->slug .'" role="tab" data-toggle="tab">'. $single_term->name .'</a></li>';
$x++;
}
?>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<?php
$x = 0;
foreach($all_terms as $single){
$active = '';
if($x == 0){
$active = 'in active';
}
?>
<div class="tab-pane fade <?php echo $active; ?>" id="<?php echo $single->slug; ?>">
<?php
$ebit_post = new WP_Query(array(
'post_type' => 'filtering',
'posts_per_page' => -1,
'filtering_category' => $single->slug
));
if($ebit_post->have_posts()){
while($ebit_post->have_posts()){
$ebit_post->the_post(); ?>
<div class="single_tab_item">
<h2><?php the_title(); ?></h2>
<?php the_post_thumbnail(); ?>
</div>
<?php }
wp_reset_postdata();
}
?>
</div>
<?php $x++; }
?>
</div>
</div>
</div>
</div>
</div>
</section>
<?php get_footer();