-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-photo.php
100 lines (83 loc) · 3.49 KB
/
archive-photo.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
<?php
/**
* The template for displaying Archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package sf
* @since sf 1.0
*/
get_header(); ?>
<section id="primary"
class="content-area">
<div class="site-content" role="main">
<div class="row">
<div id="main" class="twelve columns" role="main">
<?php
if ( is_active_sidebar('top') ) {
// Display some text
echo('<div class="row"><div class="twelve columns">');
get_sidebar('top');
echo('</div></div>');
} else {
// Display none
};
?>
<?php if ( have_posts() ) : ?>
<div id="posts_wrapper" class="am-container sf-gallery ">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
$img = get_field('bild');
$img = wp_get_attachment_image_src( $img['id'], 'medium' );
?>
<a href="#"><img data-width="<?php echo($img[1]);?>" data-height="<?php echo($img[2]);?>" src="<?php echo($img[0]);?>"></img></a>
<a href="#"><img data-width="<?php echo($img[1]);?>" data-height="<?php echo($img[2]);?>" src="<?php echo($img[0]);?>"></img></a>
<?php endwhile; ?>
</div>
<script type="text/javascript">
jQuery(function($) {
var $container = $('#posts_wrapper'),
$imgs = $container.find('img').show(),
totalImgs = $imgs.length,
cnt = 0;
$imgs.each(function(i) {
var $img = $(this);
jQuery('<img/>').load(function() {
++cnt;
if( cnt === totalImgs ) {
$imgs.show();
$container.montage({
maxh:200,
margin: 0
});
}
}).attr('src',$img.attr('src'));
});
});
</script>
<?php //sf_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'archive' ); ?>
<?php endif; ?>
<div id="pagenavigation_wrapper">
<?php if (function_exists('foundation_page_navi')) { ?>
<?php foundation_page_navi(); ?>
<?php } else { ?>
<nav class="wp-prev-next">
<ul class="clearfix">
<li class="prev-link"><?php next_posts_link(_e('« Older Entries', "sf")) ?>
</li>
<li class="next-link"><?php previous_posts_link(_e('Newer Entries »', "sf")) ?>
</li>
</ul>
</nav>
<?php } ?>
</div>
</div>
<!-- #content .site-content -->
</div>
</div>
<!-- #primary .content-area -->
</section>
<?php get_footer(); ?>