-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloop.php
executable file
·29 lines (29 loc) · 1.28 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
<?php if (is_page()): the_post() ?>
<article id="page-<?php the_ID() ?>">
<?php the_content(); ?>
</article>
<?php else: ?>
<?php if (have_posts()):
while (have_posts()) : the_post() ?>
<article id="article-<?php the_ID() ?>" class="article">
<header class="article-header">
<?php if (has_post_thumbnail() and !is_singular()): ?>
<div class="featured-image">
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute() ?>"><?php the_post_thumbnail() ?></a>
</div>
<?php endif; ?>
<h1 class="article-title"><?php if(!is_singular()): ?><a href="<?php the_permalink() ?>" title="<?php the_title_attribute() ?>"><?php endif; the_title() ?><?php if(!is_singular()): ?></a><?php endif; ?></h1>
<div class="article-info">
<span class="date"><?php the_date('m-d-Y') ?></span>
<span class="comments"><?php comments_popup_link(__('Leave a comment'), __('1 Comment'), __('% Comments')) ?></span>
</div>
</header>
<div class="article-content">
<?php (is_single()) ? the_content() : the_excerpt() ?>
</div>
</article>
<?php endwhile; ?>
<?php else: ?>
<p>Nothing matches your query.</p>
<?php endif; ?>
<?php endif; ?>