This repository was archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathloop-post.php
More file actions
123 lines (95 loc) · 3.47 KB
/
loop-post.php
File metadata and controls
123 lines (95 loc) · 3.47 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
/**
* The template for displaying the post template/grid loop.
*
* @package Bricks
* @link https://themebeans.com/themes/bricks
*/
// FORMAT
$format = get_post_format();
if ( false === $format ) {
$format = 'standard'; }
// META
$link = get_post_meta( $post->ID, '_bean_link_url', true );
$terms = get_the_terms( $post->ID, 'category' );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( is_sticky() ) {
echo '<span></span>'; }
?>
<?php
if ( ! post_password_required() && $format != 'aside' ) {
get_template_part( 'inc/post-formats/content', $format ); }
?>
<div class="entry-meta">
<?php if ( is_singular() ) { ?>
<p class="by">
<strong><?php esc_html_e( 'By:', 'bricks' ); ?></strong>
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>
</p>
<?php } ?>
<p class="published">
<strong><?php esc_html_e( 'Date:', 'bricks' ); ?></strong>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'bricks' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_time( get_option( 'date_format' ) ); ?></a>
</p>
<?php if ( is_singular() ) { ?>
<?php if ( $terms && ! is_wp_error( $terms ) ) : ?>
<p class="category">
<strong><?php esc_html_e( 'Category:', 'bricks' ); ?></strong>
<?php the_terms( $post->ID, 'category', '', ', ', '' ); ?>
</p>
<?php endif; ?>
<?php if ( get_theme_mod( 'show_tags' ) == true && has_tag() ) { ?>
<p class="tags">
<strong><?php esc_html_e( 'Tags:', 'bricks' ); ?></strong>
<?php echo the_tags( '', '', '' ); ?>
</p>
<?php } ?>
<?php if ( get_theme_mod( 'post_sharing' ) == true ) { ?>
<?php get_template_part( 'content', 'post-social' ); ?>
<?php } ?>
<?php } //END is_singular() ?>
</div><!-- END .entry-meta -->
<div class="entry-content">
<?php if ( $format == 'link' ) { // IF LINK FORMAT, USE THE LINK INSERTED IN LEUI OF THE PERMALINK ?>
<?php if ( is_singular() ) { ?>
<h1 class="entry-title">
<a target="blank" href="<?php echo esc_url( $link ); ?>"><?php the_title(); ?></a><span class="icon-link"></span>
</h1><!-- END .entry-title -->
<?php } else { ?>
<h2 class="entry-title">
<a target="blank" href="<?php echo esc_url( $link ); ?>"><?php the_title(); ?></a><span class="icon-link"></span>
</h2><!-- END .entry-title -->
<?php } ?>
<?php
} elseif ( $format == 'aside' or $format == 'quote' ) {
// NO TITLE FOR THE ASIDE POST FORMAT
} else {
?>
<?php if ( is_singular() ) { ?>
<h1 class="entry-title">
<?php the_title(); ?>
</h1><!-- END .entry-title -->
<?php } else { ?>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'bricks' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2><!-- END .entry-title -->
<?php } ?>
<?php } //END if( $format == 'link') ?>
<?php edit_post_link( __( '[Edit]', 'bricks' ), '', '' ); ?>
<?php the_content( __( '<span>Continue Reading</span>', 'bricks' ) ); ?>
<?php if ( is_singular() ) { ?>
<?php
wp_link_pages(
array(
'before' => '<p><strong>' . __( 'Pages:', 'bricks' ) . '</strong> ',
'after' => '</p>',
'next_or_number' => 'number',
)
);
?>
<?php comments_template( '', true ); ?>
<?php } //END is_singular() ?>
</div><!-- END .entry-content -->
</article>