-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
51 lines (46 loc) · 1.79 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
<?php
get_header();
if (get_header_image() == false){
$homeImage = get_template_directory_uri() . '/assets/img/default.jpg';
} else {
$homeImage = get_header_image();
}
$homePageData = array();
if (get_theme_mod('front_page_title_setting') != false || get_theme_mod('front_page_textarea_setting') != false ) {
array_push($homePageData, get_theme_mod('front_page_title_setting'), get_theme_mod('front_page_textarea_setting'));
}
if (get_theme_mod('front_page_logo_setting')) {
$logo = get_theme_mod('front_page_logo_setting');
}
if (get_header_image()):
?>
<div class="bg-dark front-page-banner" style="background-image: url(<?= $homeImage; ?>);">
<?php if (sizeof($homePageData) === 2 || $logo): ?>
<div class="container position-relative">
<?php if ($logo): ?>
<img class="frontLogo" src="<?= $logo ?>" alt="Company Logo">
<?php endif ?>
<?php if (sizeof($homePageData) === 2): ?>
<a class="frontScroll" href="#information"><?= get_theme_mod('front_page_title_setting') ?><span class="dashicons dashicons-arrow-down-alt "> </span></a>
<?php endif ?>
</div>
<?php endif ?>
</div>
<?php
endif;
if (sizeof($homePageData) === 2):
?>
<div class="container main">
<div class="row">
<div class="col-sm-6 home-text">
<h2 id="information"><?= get_theme_mod('front_page_title_setting') ?></h2>
<p><?= get_theme_mod('front_page_textarea_setting') ?></p>
</div>
<div class="d-none d-sm-block col-6 home-image-size">
</div>
</div>
</div>
<?php
endif;
get_footer();
?>