-
Notifications
You must be signed in to change notification settings - Fork 4
/
page-level-one.php
78 lines (72 loc) · 3.01 KB
/
page-level-one.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
<?php
/*
* Template Name: Level one
*
*/
get_header(); ?>
<?php get_template_part( 'breadcrumb' ); ?>
<div id="primary" class="level-one">
<?php while ( have_posts() ) : the_post(); ?>
<div class="container">
<div class="row" role="banner">
<div class="col-md-12">
<?php
global $post;
$image = make_path_relative_no_pre_path( get_feature_image_url( $post->ID, 'full-page-width', true ) );
$title = get_the_title();
$content = get_post_meta( $post->ID, 'level_one_tag_line', true );
$button = get_post_meta( $post->ID, 'action_button_title', true );
$url = get_post_meta( $post->ID, 'action_button_url', true );
?>
<div class="banner feature-img feature-img-bg" <?php echo $image; ?>>
<div class="entry-header">
<h1><?php echo $title; ?></h1>
</div>
<?php if ( $content ) { ?>
<div class="entry-content">
<div class="tag-line">
<?php echo $content; ?>
</div>
<?php if ( $button ) { ?>
<div class="call-to-action-button">
<a href="<?php echo $url; ?>" title="<?php echo $button; ?>"
class="button">
<?php echo $button; ?>
</a>
</div>
<?php } ?>
</div>
<?php } ?>
<?php get_image_caption( 'top' ) ?>
</div>
</div>
</div>
</div>
<main id="main" role="main">
<?php
$section_1 = get_post_meta( $post->ID, 'level_one_template_part_1', true );
$section_2 = get_post_meta( $post->ID, 'level_one_template_part_2', true );
$section_3 = get_post_meta( $post->ID, 'level_one_template_part_3', true );
if ( $section_1 ) {
echo '<section id="'.$section_1.'" class="section-1">';
get_template_part( 'partials/'.$section_1 );
echo '</section>';
}
if ( $section_2 ) {
echo '<section id="'.$section_2.'" class="section-2">';
get_template_part( 'partials/'.$section_2 );
echo '</section>';
}
if ( $section_3 ) {
echo '<section id="'.$section_3.'" class="section-3">';
get_template_part( 'partials/'.$section_3 );
echo '</section>';
}
echo '<section id="content-cards" class="section-cards">';
get_template_part( 'partials/level-one-cards' );
echo '</section>';
?>
</main>
<?php endwhile; ?>
</div>
<?php get_footer(); ?>