-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevent.php
113 lines (99 loc) · 2.88 KB
/
event.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
113
<?php
/*
Template Name: Event Page
Description: Event Page.
*/
remove_filter( 'the_content', 'wpautop' );
?>
<style>
.hero-image{
background:url('<?php the_post_thumbnail_url( 'full' ); ?>') center center;
/*background-color: rgba(255, 0, 179, 0.65);*/
/*background-blend-mode: difference;*/
background-size:cover;
position: relative;
}
.hero-image h1 {
position: absolute;
top: 50%;
left: 50%;
padding: 0;
margin: 0;
transform: translate(-50%, -85%);
font-size: 10vw;
color: #fff;
text-shadow: 2px 2px 4px black;
}
.sub-heading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, 0%);
font-size: 4.3vw;
color: #fff;
text-shadow: 1px 1px 2px black;
}
.tag-line {
position: absolute;
left: 50%;
bottom: 10%;
padding: 0;
margin: 0;
transform: translate(-50%, -10%);
font-size: 2.5vw;
color: #fff;
text-shadow: 1px 1px 2px black;
}
</style>
<?php get_header(); ?>
<div id="hero_image" class="hero-image">
<h1><?php the_title(); ?></h1>
<?php if(get_post_meta($post->ID, 'sub-heading', true)): ?>
<div class="sub-heading"><?php echo get_post_meta($post->ID, 'sub-heading', true); ?></div>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'tag-line', true)): ?>
<div class="tag-line"><?php echo get_post_meta($post->ID, 'tag-line', true); ?></div>
<?php endif; ?>
</div>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(__('(more...)')); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<script>
function fix_header_top() {
$(window).scroll(function () {
if ($(this).scrollTop() > $('#hero_image').outerHeight(true) + $('#ucfhb').outerHeight(true)) {
$('#navbar_events').addClass('navbar-fixed-top');
$('body').addClass('fixed-header-padding');
} else {
$('#navbar_events').removeClass('navbar-fixed-top');
$('body').removeClass('fixed-header-padding');
}
});
};
function add_scroll_spy(){
$('body').attr('data-spy', 'scroll');
$('body').attr('data-target', '#navbar_events');
$('body').attr('data-offset', '51');
}
//Scrolls the page to the element the link is pointed to.
function scroll_to_element(){
$('.scroll-to-element').click(function(e) {
var jump = $(this).attr('href');
var new_position = $(jump).offset();
$('html, body').stop().animate({ scrollTop: new_position.top - 49 }, 500);
e.preventDefault();
$("#main_menu").collapse('hide');
})
}
$(document).ready( function() {
fix_header_top();
add_scroll_spy();
scroll_to_element();
$('body').removeClass('library-body');
$('.main-header').remove();
$('.main-footer').remove();
});
</script>
<?php get_footer(); ?>