-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtemplate_tab.php
More file actions
74 lines (64 loc) · 1.81 KB
/
template_tab.php
File metadata and controls
74 lines (64 loc) · 1.81 KB
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
<?php
/*
Template Name: Tab Page
*/
get_header();?>
<section class="tab_area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="tab_style_one">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<?php
$ebit_post = null;
$ebit_post = new WP_Query(array(
'post_type' => 'tab',
'posts_per_page' => -1
));
if( $ebit_post->have_posts() ){
$x = 0;
while( $ebit_post->have_posts() ){
$ebit_post->the_post();
$tab_name = get_post_meta(get_the_ID(), '_office-master_tab_name', true);
?>
<li class="<?php if($x == 0){ echo 'active';}?>"><a href="#tab1-id-<?php the_ID(); ?>" role="tab" data-toggle="tab"><?php echo $tab_name;?></a></li>
<?php $x++;}
}else{
echo 'No post';
}
wp_reset_postdata();
$ebit_post = null;
?>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<?php
$ebit_post = null;
$ebit_post = new WP_Query(array(
'post_type' => 'tab',
'posts_per_page' => -1
));
if( $ebit_post->have_posts() ){
$x = 0;
while( $ebit_post->have_posts() ){
$ebit_post->the_post();
$tab_name = get_post_meta(get_the_ID(), '_office-master_tab_name', true);
?>
<div class="tab-pane fade <?php if($x == 0){echo 'in active';}?>" id="tab1-id-<?php the_ID(); ?>">
<?php the_content();?>
</div>
<?php $x++;}
}else{
echo 'No post';
}
wp_reset_postdata();
$ebit_post = null;
?>
</div>
</div>
</div>
</div>
</div>
</section>
<?php get_footer();?>