forked from HYnotAnightClub/bittersTheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop.php
81 lines (70 loc) · 3.19 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
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
<?php // If there are no posts to display, such as an empty archive page ?>
<?php if ( ! have_posts() ) : ?>
<article id="post-0" class="post error404 not-found">
<h1 class="entry-title">Not Found</h1>
<section class="entry-content">
<p>Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.</p>
<?php get_search_form(); ?>
</section><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; // end if there are no posts ?>
<?php // if there are posts, Start the Loop. ?>
<?php $count = 0; ?>
<?php while ( have_posts() ) : the_post(); ?>
<!-- modulo goes here -->
<?php $count++; ?>
<!-- odd numbers go left, even numbers go right -->
<?php if ( $count%2==0 ){ ?>
<div class="left-side-post">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="Permalink to: <?php esc_attr(the_title_attribute()); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
<?php echo the_post_thumbnail(); ?>
<section class="entry-content">
<?php the_excerpt(); ?>
<?php wp_link_pages( array(
'before' => '<div class="page-link"> Pages:',
'after' => '</div>'
)); ?>
</section><!-- .entry-content -->
<footer>
<p><?php the_tags('Tags: ', ', ', '<br>'); ?> Posted in <?php the_category(', '); ?></p>
<p><?php comments_popup_link('Respond to this post »', '1 Response »', '% Responses »'); ?></p>
<p><?php edit_post_link( 'Edit', '<span class="edit-link">', '</span>' ); ?></p>
</footer>
</article><!-- #post-## -->
</div>
<?php } else {?>
<div class="right-side-post">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="Permalink to: <?php esc_attr(the_title_attribute()); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
<?php echo the_post_thumbnail(); ?>
<section class="entry-content">
<?php the_excerpt(); ?>
<?php wp_link_pages( array(
'before' => '<div class="page-link"> Pages:',
'after' => '</div>'
)); ?>
</section><!-- .entry-content -->
<footer>
<p><?php the_tags('Tags: ', ', ', '<br>'); ?> Posted in <?php the_category(', '); ?></p>
<p><?php comments_popup_link('Respond to this post »', '1 Response »', '% Responses »'); ?></p>
<p><?php edit_post_link( 'Edit', '<span class="edit-link">', '</span>' ); ?></p>
</footer>
</article><!-- #post-## -->
</div>
<?php } ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // End the loop. Whew. ?>
<?php // Display navigation to next/previous pages when applicable ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<p class="alignleft"><?php next_posts_link('« Older Entries'); ?></p>
<p class="alignright"><?php previous_posts_link('Newer Entries »'); ?></p>
<?php endif; ?>