-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathloop.php
54 lines (47 loc) · 1.39 KB
/
loop.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
<ul class="list-posts row">
<?php while(have_posts()) : the_post(); ?>
<li id="post-<?php the_ID(); ?>" <?php post_class('post-item three columns'); ?>>
<article>
<header class="post-header">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php
if(has_post_thumbnail())
the_post_thumbnail('post-thumb');
else
echo '<img src="' . get_post_meta($post->ID, 'picture', true) . '" />';
?>
</a>
<p class="meta clearfix">
<span class="date">
<span class="lsf"></span>
<span class="date-content"><?php echo get_the_date('m/d/Y'); ?></span>
</span>
</p>
</header>
</article>
</li>
<?php endwhile; ?>
</ul>
<div class="twelve columns">
<?php if(function_exists('wp_paginate')) wp_paginate(); ?>
</div>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.list-posts').imagesLoaded(function() {
var $media = $('.list-posts .media-limit img');
$media.each(function() {
var containerHeight = $(this).parents('.media-limit').height();
var imageHeight = $(this).height();
var topOffset = (containerHeight - imageHeight) / 2;
if(topOffset < 0) {
$(this).css({
'margin-top': topOffset
});
}
});
});
});
})(jQuery);
</script>