-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop.php
47 lines (36 loc) · 1.52 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
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- post thumbnail -->
<?php if ( has_post_thumbnail() ) : // Check if thumbnail exists. ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail( array( 120, 120 ) ); // Declare pixel size you need inside the array. ?>
</a>
<?php endif; ?>
<!-- /post thumbnail -->
<!-- post title -->
<h2>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
</h2>
<!-- /post title -->
<!-- post details -->
<span class="date">
<time datetime="<?php the_time( 'Y-m-d' ); ?> <?php the_time( 'H:i' ); ?>">
<?php the_date(); ?> <?php the_time(); ?>
</time>
</span>
<span class="author"><?php esc_html_e( 'Published by', 'creativity' ); ?> <?php the_author_posts_link(); ?></span>
<span class="comments"><?php if ( comments_open( get_the_ID() ) ) comments_popup_link( __( 'Leave your thoughts', 'creativity' ), __( '1 Comment', 'creativity' ), __( '% Comments', 'creativity' ) ); ?></span>
<!-- /post details -->
<?php creativity_wp_excerpt( 'creativity_wp_index' ); // Build your custom callback length in functions.php. ?>
<?php edit_post_link(); ?>
</article>
<!-- /article -->
<?php endwhile; ?>
<?php else : ?>
<!-- article -->
<article>
<h2><?php esc_html_e( 'Sorry, nothing to display.', 'creativity' ); ?></h2>
</article>
<!-- /article -->
<?php endif; ?>