-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtpl-home.php
More file actions
150 lines (135 loc) · 6.68 KB
/
tpl-home.php
File metadata and controls
150 lines (135 loc) · 6.68 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
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
146
147
148
149
150
<?php
/**
* Template Name: Home
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*
* The template for displaying all pages.
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
*/
get_header();
?>
<div id="fullpage" class="creativity-home">
<div class="creativity-main-section" data-anchor="home">
<?php
$section_id = esc_attr(get_theme_mod( 'creativity_section_home', '' ));
$slider_cat = absint(get_theme_mod( 'creativity_slider_category', 0 ));
?>
<section id="home" data-anchor="<?php echo esc_attr($section_id); ?>" class="sec-slide slider-section" data-index="1">
<?php if( isset( $slider_cat ) && $slider_cat != 0 ): ?>
<?php
$cat_args = array( 'cat' => $slider_cat );
$cat_query = new WP_Query( $cat_args );
if( $cat_query->have_posts() ) {
echo '<ul class="creativity-slider">';
while( $cat_query->have_posts() ) {
$cat_query->the_post();
$post_thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
echo '<li class="bx-slides">';
?>
<div class="slide-bg" style="background-image:url(<?php echo esc_url($post_thumb[0]); ?>)"></div>
<?php if( esc_attr(get_theme_mod( 'creativity_slider_caption', 'yes' )) == 'yes' ): ?>
<div class="slide-caption slideInUp animated">
<div class="slide-title">
<?php echo wp_kses_post(get_the_title()); ?>
</div>
<div class="slide-desc">
<?php echo wp_kses_post(get_the_content()); ?>
</div>
</div>
<?php endif;
echo '</li>';
}
echo '</ul>';
wp_reset_postdata();
}
endif; ?>
<div class="h-logo">
<?php
$h_logo = esc_url(get_theme_mod( 'creativity_home_logo', '' ));
if( $h_logo ){
?>
<img src="<?php echo esc_url($h_logo); ?>" >
<?php
}
?>
</div>
</section>
<?php
$data_index = 1; // For section data-index
for( $i=1; $i<=7; $i++ ) {
if(!get_theme_mod( 'creativity_section_'.$i.'_disable')){
$section_id = sanitize_title(get_theme_mod( 'creativity_section_'.$i, '' ));
$section_type = sanitize_text_field(get_theme_mod( 'creativity_section_'.$i.'_type', 'page' ));
if($section_type == 'page') {
$section = 'page';
$page_id = absint(get_theme_mod( 'creativity_section_page_'.$i));
} else {
$section = sanitize_text_field(get_theme_mod('creativity_section_layout'.$i, 'services'));
}
$class = $section.'-section';
?>
<section id="<?php echo esc_attr($section_id); ?>" data-anchor="<?php echo esc_attr($section_id); ?>" class="sec-slide <?php echo esc_attr($class); ?>" data-index="<?php echo absint(++$data_index); ?>">
<?php
switch ($section) {
case 'page' :
creativity_slide_page($page_id);
break;
case 'services' :
creativity_slide_service();
break;
case 'portfolio' :
creativity_slide_portfolio();
break;
case 'clients' :
creativity_slide_clients();
break;
case 'contact' :
creativity_slide_contact();
break;
case 'blog' :
creativity_slide_blog();
break;
default :
get_template_part( 'template-parts/content', 'none' );
break;
}
?>
</section>
<?php
}
} // end of for
?>
<div class="scme_fulpg_arrow">
<?php $tpl_color = get_theme_mod('creativity_tpl_color', '#DF2C45'); ?>
<span id="moveLeft" class="fp-controlArrow fp-prev">
<svg width="50" height="50" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">
<g>
<title>Layer 1</title>
<g id="svg_1" fill="<?php echo esc_attr($tpl_color); ?>" transform="translate(0.000000,50.000000) scale(0.100000,-0.100000)">
<path id="svg_2" d="m120,375c-68,-68 -121,-128 -117,-132c4,-4 62,47 127,112l120,120l112,-113l113,-112l-112,-112l-113,-113l-84,84c-46,46 -89,82 -95,80c-6,-2 32,-47 84,-99l95,-95l127,128l128,127l-125,125c-69,69 -127,125 -130,125c-3,0 -61,-56 -130,-125z"/>
<path id="svg_3" d="m172,307l-22,-23l25,-24c26,-25 47,-21 25,5c-11,13 -5,15 44,15l56,0l0,-71c0,-47 4,-69 11,-67c7,2 11,33 11,78l0,75l-66,0c-41,0 -62,3 -56,10c6,5 10,13 10,17c0,15 -16,8 -38,-15z"/>
</g>
</g>
</svg>
</span>
<span id="moveRight" class="fp-controlArrow fp-next">
<svg width="50" height="50" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">
<g>
<title>Layer 1</title>
<g id="svg_1" fill="<?php echo esc_attr($tpl_color); ?>" transform="translate(0.000000,50.000000) scale(0.100000,-0.100000)">
<path id="svg_2" d="m120,375l-125,-125l128,-127l127,-128l95,95c52,52 90,97 84,99c-6,2 -49,-34 -95,-80l-84,-84l-113,113l-112,112l113,112l112,113l120,-120c65,-65 123,-116 127,-112c6,7 -234,257 -247,257c-3,0 -61,-56 -130,-125z"/>
<path id="svg_3" d="m290,322c0,-4 4,-12 10,-17c6,-7 -14,-10 -53,-10c-34,0 -63,-3 -64,-7c-8,-23 -2,-148 7,-148c6,0 10,30 10,70l0,70l56,0c49,0 55,-2 44,-15c-22,-26 -1,-30 25,-5l25,24l-22,23c-22,23 -38,30 -38,15z"/>
</g>
</g>
</svg>
</span>
</div>
</div>
</div> <!-- #fullpage -->
<?php
get_footer();