/
woocommerce.php
163 lines (139 loc) · 3.61 KB
/
woocommerce.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/**
* The main template file for display page.
*
* @package WordPress
*/
/**
* Get current page id
**/
$current_page_id = get_option( 'woocommerce_shop_page_id' );
get_header();
//Get Shop Sidebar
$page_sidebar = '';
//Get Shop Sidebar Display Settting
$tg_shop_layout = kirki_get_option('tg_shop_layout');
if(THEMEDEMO && isset($_GET['sidebar']))
{
$tg_shop_layout = 'sidebar';
}
if($tg_shop_layout == 'sidebar')
{
$page_sidebar = 'Shop Sidebar';
}
if(is_product())
{
$page_sidebar = '';
}
?>
<?php
$page_show_title = 0;
if(is_single())
{
$page_show_title = 1;
}
if(empty($page_show_title))
{
if(!is_category())
{
$page_title = get_the_title($current_page_id);
//Get current page tagline
$page_tagline = get_post_meta($current_page_id, 'page_tagline', true);
}
else
{
$page_title = get_the_title();
$page_tagline = '';
}
$pp_page_bg = '';
$shop_page_id = get_option( 'woocommerce_shop_page_id' );
//Get page featured image
if(has_post_thumbnail($shop_page_id, 'full'))
{
$image_id = get_post_thumbnail_id($shop_page_id);
$image_thumb = wp_get_attachment_image_src($image_id, 'full', true);
if(isset($image_thumb[0]) && !empty($image_thumb[0]))
{
$pp_page_bg = $image_thumb[0];
}
}
//Check if add blur effect
$tg_page_title_img_blur = kirki_get_option('tg_page_title_img_blur');
global $global_pp_topbar;
?>
<div id="page_caption" <?php if(!empty($pp_page_bg)) { ?>class="hasbg parallax"<?php } ?>>
<?php if(!empty($pp_page_bg)) { ?>
<div id="bg_regular" style="background-image:url(<?php echo esc_url($pp_page_bg); ?>);"></div>
<?php } ?>
<?php
if(!empty($tg_page_title_img_blur) && !empty($pp_page_bg))
{
?>
<div id="bg_blurred" style="background-image:url(<?php echo get_template_directory_uri().'/modules/blurred.php?src='.esc_url($pp_page_bg); ?>);"></div>
<?php
}
?>
<div class="page_title_wrapper">
<div class="page_title_inner">
<h1 <?php if(!empty($pp_page_bg) && !empty($global_pp_topbar)) { ?>class ="withtopbar"<?php } ?>><?php echo tg_get_first_title_word(esc_html($page_title)); ?></h1>
<?php
if(!empty($page_tagline))
{
?>
<div class="page_tagline">
<?php echo wp_kses_post($page_tagline); ?>
</div>
<?php
}
?>
</div>
<?php if(empty($pp_page_bg)) { ?>
<br class="clear"/>
<?php
}
?>
</div>
</div>
<?php
}
?>
<!-- Begin content -->
<div id="page_content_wrapper" <?php if(!empty($pp_page_bg)) { ?>class="hasbg"<?php } ?>>
<div class="inner ">
<!-- Begin main content -->
<div class="inner_wrapper no-top-padding">
<div class="sidebar_content <?php if(empty($page_sidebar)) { ?>full_width<?php } else { ?>left_sidebar<?php } ?>">
<?php woocommerce_content(); ?>
</div>
<?php if(!empty($page_sidebar)) { ?>
<div class="sidebar_wrapper left_sidebar">
<div class="sidebar">
<div class="content">
<?php
$page_sidebar = sanitize_title($page_sidebar);
if (is_active_sidebar($page_sidebar)) { ?>
<ul class="sidebar_widget">
<?php dynamic_sidebar($page_sidebar); ?>
</ul>
<?php } ?>
</div>
</div>
<br class="clear"/>
<div class="sidebar_bottom"></div>
</div>
<br class="clear"/><br/>
<?php } ?>
</div>
<!-- End main content -->
</div>
</div>
<?php
if(is_single())
{
?>
<br class="clear"/><br/>
<?php
}
?>
<!-- End content -->
<?php get_footer(); ?>