-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop.php
executable file
·67 lines (63 loc) · 2.7 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
<?php
/**
* @package WordPress
* @subpackage monochromatic
*/
?>
<?php monochromatic_before_loop(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<a class="title-link" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title('<h3 class="post-title">', '</h3>'); ?></a>
<?php if (!is_page()) { ?>
<section class="pre-meta">
<p>Posted by <?php the_author_posts_link(); ?> on <?php echo get_the_date(); ?></p>
</section>
<?php } ?>
<?php if ( get_theme_mod( 'monochromatic_featured_image' ) == "yes") : ?>
<?php the_post_thumbnail(full); ?>
<?php endif; ?>
<section class="entry">
<?php if (is_singular()) { the_content("Continue reading " . the_title('', '', false));
} else { ?>
<?php if ( get_theme_mod( 'monochromatic_post_excerpt' ) == "short") : ?>
<p><?php echo wp_trim_words( get_the_content() , '55' ); ?></p>
<?php elseif ( get_theme_mod( 'monochromatic_post_excerpt' ) == "medium") : ?>
<p><?php echo wp_trim_words( get_the_content() , '110' ); ?></p>
<?php elseif ( get_theme_mod( 'monochromatic_post_excerpt' ) == "long") : ?>
<p><?php echo wp_trim_words( get_the_content() , '165' ); ?></p>
<?php else : ?>
<?php the_content("Continue reading " . the_title('', '', false)); ?>
<?php endif; ?>
<?php } ?>
<?php wp_link_pages( $args ); ?>
</section>
<?php if (!is_page()) { ?>
<section class="post-meta">
<?php if ( get_theme_mod( 'monochromatic_tags' ) == "yes") : ?>
<p class="remove-bottom">Categories: <?php the_category(' '); ?> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
<p><?php the_tags(); ?></p>
<?php else : ?>
<p>Categories: <?php the_category(' '); ?> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
<?php endif; ?>
</section>
<?php } ?>
</article>
<?php endwhile; ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="pagination">
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
?>
</nav><!-- #nav-below -->
<?php endif; ?>
<?php /* Only load comments on single post */ ?>
<?php if(is_single()) : comments_template( '', true ); endif; ?>
<?php monochromatic_after_loop(); ?>