-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
145 lines (127 loc) · 5.11 KB
/
index.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/**
* The main template file.
*
*/
?>
<?php
if ( 'page' == get_option( 'show_on_front' ) && ( '' != get_option( 'page_for_posts' ) ) && $wp_query->get_queried_object_id() == get_option( 'page_for_posts' ) ) {
get_header("site");
?>
<div class="site-main">
<div class="main-content">
<div class="content-area">
<div class="site-content" role="main">
<header class="archive-header">
<h1 class="archive-title"><?php onetone_get_breadcrumb();?></h1>
</header>
<?php if (have_posts()) :?>
<?php while ( have_posts() ) : the_post();
get_template_part("content","article");
?>
<?php endwhile;?>
<?php endif;?>
<nav class="paging-navigation">
<div class="loop-pagination">
<?php if(function_exists("onetone_native_pagenavi")){onetone_native_pagenavi("echo",$wp_query);}?>
</div>
</nav>
</div>
</div>
</div>
<!--main-->
<div class="sidebar">
<div class="widget-area">
<?php dynamic_sidebar(1) ;?>
</div>
</div>
<!--sidebar-->
</div>
<?php
get_footer("site");
}else{
?>
<?php
get_header();
?>
<!--<link href="<?php echo get_template_directory_uri();?>/style-template.css?ver="<?php echo time();?> />
<link href="<?php echo get_template_directory_uri();?>/style_new.css?ver="<?php echo time();?> />-->
<div class="container home-wrapper">
<?php
global $onetone_options;
$video_array = array();
$section_num = onetone_options_array( 'section_num' );
$facebook_link = onetone_options_array( 'facebook_link' );
$section_background_video = onetone_options_array( 'section_background_video_0' );
$video_background_section = onetone_options_array( 'video_background_section' );
$video_background_section = $video_background_section == ""?1:$video_background_section;
$video_controls = onetone_options_array( 'video_controls' );
$video_controls = $video_controls == ""?1:$video_controls;
$section_1_content = onetone_options_array( 'section_1_content' );
if(isset($section_num) && is_numeric($section_num ) && $section_num >0):
for( $i = 0; $i < $section_num ;$i++){
if( $section_1_content == 'slider' && $i == 0 ){
echo onetone_get_default_slider();
}else{
$section_title = onetone_options_array( 'section_title_'.$i );
$section_menu = onetone_options_array( 'menu_title_'.$i );
$section_background = onetone_options_array( 'section_background_'.$i );
$section_background_img = $section_background['image'];
$section_css_class = onetone_options_array( 'section_css_class_'.$i );
$section_content = onetone_options_array( 'section_content_'.$i );
if(!isset($section_content) || $section_content=="") $section_content = onetone_options_array( 'sction_content_'.$i );
$section_slug = onetone_options_array( 'menu_slug_'.$i );
$background = onetone_get_background($section_background);
$sanitize_title = "";
if($section_menu && $section_menu != ""){
$sanitize_title = sanitize_title($section_menu );
if(trim($section_slug) !=""){
$sanitize_title = $section_slug;
}
}
$css_class = isset($section_css_class)?$section_css_class:"";
$background_video = '';
$video_wrap = '';
$video_enable = 0;
$detect = new Mobile_Detect;
if($section_background_video != "" && $video_background_section == ($i+1) && !$detect->isMobile() && !$detect->isTablet()){
$video_enable = 1;
}
if($video_enable == 1){
$background_video = array("videoId"=>$section_background_video, "start"=>3 ,"container" =>"section.onetone-".$sanitize_title,"playerid"=>$sanitize_title);
$video_section_item = "section.onetone-".$sanitize_title;
$video_array[] = array("options"=>$background_video, "video_section_item"=>$video_section_item );
$background = "";
$video_wrap = "video-section";
}
?>
<section id="<?php echo $sanitize_title;?>" class="section <?php echo $css_class;?> onetone-<?php echo $sanitize_title;?> <?php echo $video_wrap;?>" style=" background: url(<?php echo $section_background_img;?>);background-position: 50% 0%;background-size: cover; background-color: #000;<?php //echo $background; ?>">
<div class="home-container page_container" >
<?php if($section_title){?>
<h1><?php echo $section_title;?></h1>
<?php } ?>
<?php echo do_shortcode($section_content);?>
</div>
<div class="clear"></div>
<?php
if( $video_enable == 1 && $video_controls == 1 ){
echo '<p class="black-65" id="video-controls">
<a class="tubular-play" href="#"><i class="fa fa-play "></i></a>
<a class="tubular-pause" href="#"><i class="fa fa-pause "></i></a>
<a class="tubular-volume-up" href="#"><i class="fa fa-volume-up "></i></a>
<a class="tubular-volume-down" href="#"><i class="fa fa-volume-off "></i></a>
</p>';
}
?>
</section>
<?php
}
}
if($video_array !="" && $video_array != NULL ){
wp_localize_script( 'onetone-bigvideo', 'onetone_bigvideo',$video_array);
}
endif;
?>
<div class="clear"></div>
</div>
<?php get_footer();}?>