-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingle.php
71 lines (61 loc) · 1.87 KB
/
single.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
<?php get_header(); ?>
<article class="content-single">
<?php
if (have_posts()) :
while (have_posts()) : the_post();
if (!is_attachment()) {
get_template_part('/src/components/content', 'single');
} else {
get_template_part('/src/components/content', 'attachment');
}
endwhile;
else:
get_template_part('/src/components/content', 'none');
endif;
?>
</article>
<style type="text/css">
<?php include(get_template_directory() . '/src/assets/scss/single.css'); ?>
</style>
<script type="text/javascript" defer>
document.addEventListener('DOMContentLoaded', function() {
// parallax
initializeParallax(document.querySelector('.obtera'));
// auto enable fancybox if href is image
$('.post-content a[href$=".jpg"],' +
'.post-content a[href$=".jpeg"],' +
'.post-content a[href$=".png"],' +
'.post-content a[href$=".gif"],' +
'.post-content a [href$=".bmp"]').each(function() {
$(this).attr('data-fancybox','obtera');
$('[data-fancybox]').fancybox({
buttons: [
"zoom",
"download",
"close"
],
transitionEffect: "slide",
});
});
// auto enable fancybox on galleries
if ($('.gallery').length) {
var galleryId = $('.gallery').attr('id');
$('#' + galleryId + ' a[href$=".jpg"],' +
'#' + galleryId + ' a[href$=".jpeg"],' +
'#' + galleryId + ' a[href$=".png"],' +
'#' + galleryId + ' a[href$=".gif"],' +
'#' + galleryId + ' a[href$=".bmp"]').each(function() {
$(this).attr('data-fancybox',galleryId);
$('[data-fancybox="' + galleryId + '"]').fancybox({
buttons: [
"zoom",
"download",
"close"
],
transitionEffect: "slide",
});
});
}
});
</script>
<?php get_footer(); ?>