-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathfront-page.php
executable file
·139 lines (110 loc) · 5.27 KB
/
front-page.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
<?php
/**
* The main template file for homepage.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package dokan
* @package dokan - 2014 1.0
*/
get_header();
?>
<div id="primary" class="home-content-area col-md-9">
<div id="content" class="site-content" role="main">
<?php do_action( 'dokan_home_slider_top' ); ?>
<div class="row">
<div class="col-md-4">
<?php dokan_category_widget(); ?>
</div>
<div class="col-md-8">
<?php
if ( get_theme_mod( 'show_slider', 'on' ) == 'on' ) {
$slider_id = get_theme_mod( 'slider_id', '-1' );
if ( $slider_id != '-1' ) {
Dokan_Slider::init()->get_slider( $slider_id );
}
do_action( 'dokan_home_on_slider' );
}
?>
</div>
</div> <!-- #home-page-section-1 -->
<?php do_action( 'dokan_home_after_slider' ); ?>
<?php if ( function_exists( 'dokan_get_featured_products' ) ) { ?>
<?php if ( get_theme_mod( 'show_featured', 'on' ) == 'on' ) { ?>
<div class="slider-container woocommerce">
<h2 class="slider-heading"><?php _e( 'Featured Products', 'dokan-theme' ); ?></h2>
<div class="product-sliders">
<ul class="slides">
<?php
$featured_query = dokan_get_featured_products();
?>
<?php while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; ?>
</ul>
</div>
</div> <!-- .slider-container -->
<?php } ?>
<?php } ?>
<?php do_action( 'dokan_home_after_featured' ); ?>
<?php if ( function_exists( 'dokan_get_latest_products' ) ) {
$show_latest = get_theme_mod( 'show_latest_pro', 'on' );
if ( $show_latest === true || $show_latest == 'on' ) {
?>
<div class="slider-container woocommerce">
<h2 class="slider-heading"><?php _e( 'Latest Products', 'dokan-theme' ); ?></h2>
<div class="product-sliders">
<ul class="slides">
<?php
$latest_query = dokan_get_latest_products();
?>
<?php while ( $latest_query->have_posts() ) : $latest_query->the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; ?>
</ul>
</div>
</div> <!-- .slider-container -->
<?php } ?>
<?php } ?>
<?php if ( function_exists( 'dokan_get_best_selling_products' ) ) { ?>
<?php if ( get_theme_mod( 'show_best_selling', 'on' ) == 'on' ) { ?>
<div class="slider-container woocommerce">
<h2 class="slider-heading"><?php _e( 'Best Selling Products', 'dokan-theme' ); ?></h2>
<div class="product-sliders">
<ul class="slides">
<?php
$best_selling_query = dokan_get_best_selling_products();
?>
<?php while ( $best_selling_query->have_posts() ) : $best_selling_query->the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; ?>
</ul>
</div>
</div> <!-- .slider-container -->
<?php } ?>
<?php } ?>
<?php if ( function_exists( 'dokan_get_top_rated_products' ) ) { ?>
<?php if ( get_theme_mod( 'show_top_rated', 'on' ) == 'on' ) { ?>
<div class="slider-container woocommerce">
<h2 class="slider-heading"><?php _e( 'Top Rated Products', 'dokan-theme' ); ?></h2>
<div class="product-sliders">
<ul class="slides">
<?php
$top_rated_query = dokan_get_top_rated_products();
?>
<?php while ( $top_rated_query->have_posts() ) : $top_rated_query->the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; ?>
</ul>
</div>
</div> <!-- .slider-container -->
<?php } ?>
<?php } ?>
</div><!-- #content .site-content -->
</div><!-- #primary .content-area -->
<?php get_sidebar( 'home' );
get_footer();