-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloop.php
More file actions
executable file
·98 lines (86 loc) · 2.78 KB
/
Copy pathloop.php
File metadata and controls
executable file
·98 lines (86 loc) · 2.78 KB
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
<?php if ( ! have_posts() ) : ?>
<div id="post-0" class="post error404 not-found">
<h1 class="entry-title"><?php _e( 'Not Found', 'imbalance2' ); ?></h1>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'imbalance2' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</div><!-- #post-0 -->
<?php endif; ?>
<?php $imbalance2_theme_options = get_option('imbalance2_theme_options') ?>
<div id="boxes">
<?php while ( have_posts() ) : the_post(); ?>
<div class="box">
<div class="rel">
<div class="categories"><?php imbalance2_posted_in(); ?></div>
<h1><?php the_content(); ?></h1>
<!-- shown on hover -->
<div class="texts">
<div class="abs">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('homepage-thumb', array('alt' => '', 'title' => '')) ?>
</a>
<div class="categories"><?php imbalance2_posted_in(); ?></div>
<h1><?php the_content(); ?></h1>
</div>
</div>
<!-- end shown on hover -->
</div>
</div>
<?php endwhile; ?>
</div>
<?php if ( $wp_query->max_num_pages > 1 ) :
if ( $imbalance2_theme_options['navigation'] == 0 ) : // Default ?>
<div class="fetch">
<?php // next_posts_link( __( 'Load more posts', 'imbalance2' ) ); ?>
</div>
<script type="text/javascript">
// Ajax-fetching "Load more posts"
$('.fetch a').live('click', function(e) {
e.preventDefault();
$(this).addClass('loading').text('Loading...');
$.ajax({
type: "GET",
url: $(this).attr('href') + '#boxes',
dataType: "html",
success: function(out) {
result = $(out).find('#boxes .box');
nextlink = $(out).find('.fetch a').attr('href');
$('#boxes').append(result).masonry('appended', result);
$('.fetch a').removeClass('loading').text('Load more posts');
if (nextlink != undefined) {
$('.fetch a').attr('href', nextlink);
} else {
$('.fetch').remove();
}
}
});
});
</script>
<?php elseif ( $imbalance2_theme_options['navigation'] == 1 ) : // Infinite scroll ?>
<div class="infinitescroll">
<?php next_posts_link( __( 'Load more posts', 'imbalance2' ) ); ?>
</div>
<script type="text/javascript">
// Infinite Scroll
var href = 'first';
$(document).ready(function() {
$('#boxes').infinitescroll({
navSelector : '.infinitescroll',
nextSelector : '.infinitescroll a',
itemSelector : '#boxes .box',
loadingImg : '<?php echo get_bloginfo('stylesheet_directory') ?>/images/loading.gif',
loadingText : 'Loading...',
donetext : 'No more pages to load.',
debug : false
}, function(arrayOfNewElems) {
$('#boxes').masonry('appended', $(arrayOfNewElems));
if (href != $('.infinitescroll a').attr('href'))
{
href = $('.infinitescroll a').attr('href');
}
});
});
</script>
<?php endif; ?>
<?php endif; ?>