-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-home.php
99 lines (91 loc) · 2.98 KB
/
template-home.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
<?php
/**
* Template Name: Home
*
* The template for Home page
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package US Law Institute
*/
get_header('home'); ?>
<div class="content-area">
<main id="main" class="site-main home">
<div class="cont-home">
<div class="menu-extra-wraper">
<nav id="extra-site-navigation" class="extra-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'extra',
'menu_id' => 'extra-menu',
'menu_class' => 'menu',
) );
?>
</nav>
</div>
<div class="social-wrapper">
<?php usls_ins_display_social_network_links(); ?>
</div>
<div id="slide-hm" class="slide-home">
<?php
if( have_rows('slider') ):
while ( have_rows('slider') ) : the_row();
// sub_fields
$background_image = get_sub_field('background_image');
$red_box = get_sub_field('red_box');
$bar_text = get_sub_field('bar_text');
$button_text = get_sub_field('button_text');
$button_url = get_sub_field('button_url');
$logo = get_sub_field('logo');
?>
<div class="back-slider" style="background-image: url('<?php echo $background_image; ?>' );">
<div class="content-slider">
<div class="cont-content">
<?php if ($red_box) { ?>
<div class="redbox">
<img src="<?php echo $red_box; ?>">
</div>
<?php } ?>
<?php if ( $button_url ) : ?>
<div class="cont-btn-slide">
<button type="button" class="transition button-slide" onclick="location.href='<?php echo esc_url( $button_url ); ?>'"><?php echo esc_html( $button_text ); ?></button>
</div>
<?php endif; ?>
<?php if ($logo) { ?>
<div class="cont-logo">
<img src="<?php echo $logo; ?>">
</div>
<?php } ?>
</div>
</div>
</div>
<?php
endwhile;
endif;
?>
</div>
<div id="btns-hm" class="buttons-cta">
<?php
$online_courses = get_pages( array( 'parent' => 2, 'sort_column' => 'post_date','sort_order' => 'ASC' ) );
foreach( $online_courses as $page ) { ?>
<?php
$button_rest_state = get_field( 'button_rest_state', $page->ID );
$button_hover_state = get_field( 'button_hover_state', $page->ID );
$back_btn = get_field( 'background_image', $page->ID );
?>
<a class="btn-cta oc-link" id="btn-home" style="background-image: url('<?php echo $back_btn ?>');" rel="<?php echo $page->ID; ?>" href="<?php echo get_permalink( $page->ID ); ?>">
<img class="rest" src="<?php echo $button_rest_state; ?>">
<img class="hover" src="<?php echo $button_hover_state; ?>">
</a>
<?php } ?>
</div>
</div>
</main><!-- #main -->
<div id="single-oc-container">
</div>
<div class="contgif">
<img id="gif" style="display:none;" src="<?php echo get_template_directory_uri() . '/assets/images/loading-ui.gif';
?>">
</div>
</div><!-- .primary -->
<?php get_footer(); ?>