-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
front-page.php
112 lines (94 loc) · 4.46 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
<?php
/**
* The template for displaying the static front page.
*/
if ( !defined('ABSPATH') ){ //Redirect (for logging) if accessed directly
header('Location: http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], "wp-content/")) . '?ndaat=' . basename($_SERVER['PHP_SELF'])); //@todo "Nebula" 0: Update strpos() to str_contains() in PHP8
exit;
}
do_action('nebula_preheaders');
get_header();
?>
<?php nebula()->timer('Front Page Template'); ?>
<?php if ( get_theme_mod('nebula_hero', true) ): ?>
<section id="hero-section" class="nebulashadow inner-top inner-bottom" aria-label="hero">
<?php if ( get_theme_mod('nebula_hero_overlay_color') || get_theme_mod('nebula_hero_overlay_opacity') ): ?>
<div class="custom-color-overlay"></div>
<?php else: ?>
<div class="nebula-color-overlay"></div>
<?php endif; ?>
<?php if ( get_theme_mod('menu_position', 'over') === 'over' ): ?>
<?php get_template_part('inc/navigation'); ?>
<?php endif; ?>
<div id="hero-content" class="container">
<div class="row">
<div class="col">
<?php if ( get_theme_mod('nebula_show_hero_title', true) ): ?>
<h1><?php echo ( get_theme_mod('nebula_hero_custom_title') )? get_theme_mod('nebula_hero_custom_title') : get_bloginfo('name'); ?></h1>
<?php endif; ?>
<?php if ( get_theme_mod('nebula_show_hero_description', true) ): ?>
<h2><?php echo ( get_theme_mod('nebula_hero_custom_description') )? get_theme_mod('nebula_hero_custom_description') : get_bloginfo('description'); ?></h2>
<?php endif; ?>
<?php if ( get_theme_mod('nebula_hero_search', true) ): ?>
<?php echo nebula()->hero_search(); ?>
<?php endif; ?>
<?php if ( get_theme_mod('nebula_hero_fg_image') ): ?>
<?php if ( get_theme_mod('nebula_hero_fg_image_link') ): ?>
<a href="<?php echo get_theme_mod('nebula_hero_fg_image_link'); ?>">
<?php endif; ?>
<img src="<?php echo get_theme_mod('nebula_hero_fg_image'); ?>" alt="Hero Foreground" />
<?php if ( get_theme_mod('nebula_hero_fg_image_link') ): ?>
</a>
<?php endif; ?>
<?php endif; ?>
<?php if ( get_theme_mod('nebula_hero_youtube_id') ): ?>
<?php $youtube_data = nebula()->video_meta('youtube', get_theme_mod('nebula_hero_youtube_id')); ?>
<div class="ratio ratio-16x9">
<iframe class="youtube" title="<?php echo $youtube_data['title']; ?>" width="560" height="315" src="//www.youtube.com/embed/<?php echo $youtube_data['id']; ?>?wmode=transparent&enablejsapi=1&rel=0"></iframe>
</div>
<?php endif; ?>
</div><!--/col-->
</div><!--/row-->
<?php if ( is_active_sidebar('hero-widget-area') ): ?>
<div id="hero-widget-area" class="row justify-content-center">
<?php dynamic_sidebar('hero-widget-area'); ?>
</div><!--/row-->
<?php endif; ?>
<?php if ( get_theme_mod('nebula_hero_cta_btn_1_text') || get_theme_mod('nebula_hero_cta_btn_2_text') ): ?>
<div class="row hero-cta">
<div class="col">
<?php if ( get_theme_mod('nebula_hero_cta_btn_1_text') && get_theme_mod('nebula_hero_cta_btn_1_url') ): ?>
<a class="btn btn-lg btn-brand" href="<?php echo get_theme_mod('nebula_hero_cta_btn_1_url'); ?>"><?php echo get_theme_mod('nebula_hero_cta_btn_1_text'); ?></a>
<?php endif; ?>
<?php if ( get_theme_mod('nebula_hero_cta_btn_2_text') && get_theme_mod('nebula_hero_cta_btn_2_url') ): ?>
<a class="btn btn-lg btn-light ms-4" href="<?php echo get_theme_mod('nebula_hero_cta_btn_2_url'); ?>"><?php echo get_theme_mod('nebula_hero_cta_btn_2_text'); ?></a>
<?php endif; ?>
</div><!--/col-->
</div><!--/row-->
<?php endif; ?>
</div><!--/container-->
</section>
<?php endif; ?>
<?php get_template_part('inc/nebula_drawer'); ?>
<main id="content-section" role="main">
<div class="container">
<div class="row">
<div id="top" class="col">
<?php if ( get_option('show_on_front') === 'posts' ): //"Your latest posts" ?>
<?php get_template_part('loop', 'index'); ?>
<?php else: //"A static page" ?>
<?php if ( have_posts() ) while ( have_posts() ): the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php endwhile; ?>
<?php endif; ?>
</div><!--/col-->
<?php get_sidebar(); ?>
</div><!--/row-->
</div><!--/container-->
</main>
<?php nebula()->timer('Front Page Template', 'end'); ?>
<?php get_footer(); ?>