/
loop.php
72 lines (48 loc) · 2.03 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
<!-- Basic loop-->
<article id="post-<?php the_ID() ?>" <?php post_class(); ?>>
<div class="pre-title-meta">
<span class="the-date"><?php the_time('F jS, Y') ?></span>
</div> <!-- /pre-title-meta -->
<!-- check if we are on a single page or not, to display correct markup for title -->
<?php if( is_single() || is_page() ) { ?>
<h1 class="post-title">
<?php the_title(); ?>
</h1>
<?php } else { ?>
<h2 class="post-title">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
</h2>
<?php } //end else ?>
<!-- The post content -->
<div class="entry clearfix">
<?php
// display post thumbnail if there is one
if(has_post_thumbnail()) { ?>
<figure class="post-thumbnail alignleft">
<?php the_post_thumbnail( 'thumbnail' ); ?>
</figure> <!--/post-thumbnail -->
<?php } // endif ?>
<?php
// if the loop is on archive, category, or home and it has an exceprt it will display the excerpt
if( ( is_archive() || is_category() || is_home() ) && has_excerpt() ) { ?>
<?php the_excerpt( ); ?>
<?php } else { ?>
<?php the_content(); ?>
<?php } //end else ?>
<?php
// if the post has multiple pages
wp_link_pages( array( 'before' => '<div class="paged-post"><span>' . Pages . '</span>', 'after' => '</div>' ) );
?>
</div>
<div class="post-meta">
<!-- The author of the post -->
<span class="the-author"><?php the_author_posts_link() ?></span> –
<!-- Display a comma separated list of the Post's Categories. -->
<span class="the-category">Posted in <?php the_category(', '); ?></span>
<!-- Show off em tags -->
<span class="post-tags"><?php the_tags('– Tagged: ', ', '); ?></span> –
<!-- Display the comment count -->
<span class="comment-count"><?php comments_popup_link('Leave a comment', '1 Comment', '% Comments'); ?></span>
<?php if(is_home() ) { edit_post_link(' – edit '); } ?>
</div><!-- /post-meta -->
</article>