-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloop-blog.php
61 lines (46 loc) · 2.24 KB
/
loop-blog.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
<?php
/**
* This template displays the blog loop.
*
* @package Natural Lite
* @since Natural Lite 1.0
*/
?>
<?php $wp_query = new WP_Query( array( 'cat' => get_theme_mod( 'natural_lite_category_blog', '0' ), 'paged' => $paged ) ); ?>
<?php if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<!-- BEGIN .blog-holder -->
<div class="blog-holder">
<!-- BEGIN .post class -->
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h2 class="headline"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="post-author">
<p class="align-left"><i class="fas fa-calendar"></i> <?php esc_html_e( 'Posted on', 'natural-lite' ); ?> <?php the_time( esc_html__( 'F j, Y', 'natural-lite' ) ); ?> <?php esc_html_e( 'by', 'natural-lite' ); ?> <?php esc_url( the_author_posts_link() ); ?></p>
<p class="align-right"><i class="fas fa-comments"></i> <a href="<?php the_permalink(); ?>#comments"><?php comments_number( esc_html__( 'Leave a Comment', 'natural-lite' ), esc_html__( '1 Comment', 'natural-lite' ), '% Comments' ); ?></a></p>
</div>
<?php if ( has_post_thumbnail() ) { ?>
<a class="feature-img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php echo esc_attr( sprintf( esc_html__( 'Permalink to %s', 'natural-lite' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail( 'natural-lite-featured-large' ); ?></a>
<?php } ?>
<!-- BEGIN .article -->
<div class="article">
<?php the_content( esc_html__( 'Read More', 'natural-lite' ) ); ?>
<!-- END .article -->
</div>
<!-- END .post class -->
</div>
<!-- END .blog-holder -->
</div>
<?php endwhile; ?>
<?php if ( $wp_query->max_num_pages > 1 ) { ?>
<!-- BEGIN .pagination -->
<div class="pagination">
<?php echo natural_lite_get_pagination_links(); ?>
<!-- END .pagination -->
</div>
<?php } ?>
<?php else : ?>
<div class="error-404">
<h1 class="headline"><?php esc_html_e( 'No Posts Found', 'natural-lite' ); ?></h1>
<p><?php esc_html_e( "We're sorry, but no posts have been found. Create a post to be added to this section, and configure your theme options.", 'natural-lite' ); ?></p>
</div>
<?php endif; ?>
<?php wp_reset_postdata(); ?>