-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfront-page.php
95 lines (85 loc) · 2.5 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
<?php
/*
* Front Page Template
*/
get_header();
/**
* @hooked ascend_front_page_header - 20
*/
do_action('ascend_front_page_title_container');
?>
<div id="content" class="container homepagecontent <?php echo esc_attr( ascend_container_class() ); ?>">
<div class="row">
<div class="main <?php echo esc_attr(ascend_main_class()); ?>" role="main">
<div class="entry-content" itemprop="mainContentOfPage">
<?php
$ascend = ascend_get_options();
if(isset($ascend['homepage_layout'])) {
$layout = array();
foreach ($ascend['homepage_layout'] as $key => $value) {
if($value == 1) {
$layout[$key] = $value;
}
}
} else {
// Default layout show content
$layout = array("block_one" => "1");
}
if ($layout):
foreach ($layout as $key=>$value) {
switch($key) {
case 'block_one':
// Page Content
if(is_home()) {
get_template_part('templates/home/blog', 'main-loop');
} else {
/**
* @hooked ascend_page_content_wrap_before - 10
* @hooked ascend_page_content - 20
* @hooked ascend_page_content_wrap_after - 30
*/
do_action('ascend_page_content');
}
break;
case 'block_two':
// latest posts
get_template_part('templates/home/blog', 'home');
break;
case 'block_three':
// product carousel
if (class_exists('woocommerce')) {
get_template_part('templates/home/product', 'carousel');
}
break;
case 'block_four':
// image menu
get_template_part('templates/home/image', 'menu');
break;
case 'block_five':
// Icon menu
get_template_part('templates/home/icon', 'menu');
break;
case 'block_six':
// portfolio carousel
get_template_part('templates/home/portfolio', 'carousel');
break;
case 'block_seven':
// portfolio main loop
get_template_part('templates/home/portfolio', 'full');
break;
}
}
endif; ?>
</div>
</div><!-- /.main -->
<?php
/**
* Sidebar
*/
if (ascend_display_sidebar()) :
get_sidebar();
endif; ?>
</div><!-- /.row-->
</div><!-- /.content -->
<?php
get_footer();