forked from tenman/raindrops
/
part-blog.php
237 lines (212 loc) · 7.81 KB
/
part-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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?php
/**
* Template part file part-blog
*
* @package Raindrops
* @since Raindrops 0.1
*
* @uses the_ID( )
* @uses raindrops_post_class( )
* @uses get_option( 'date_format' )
* @uses the_time( )
* @uses get_avatar( )
* @uses apply_filters( )
* @uses the_category( )
* @uses the_tags( )
* @uses sprintf( )
* @uses get_author_posts_url( )
* @uses comments_popup_link( )
* @uses dynamic_sidebar( )
* @uses edit_post_link( )
* @uses the_permalink( )
* @uses the_title_attribute( )
* @uses raindrops_entry_title( )
* @uses raindrops_entry_content( )
* @uses wp_link_pages( )
* @uses is_single( )
* @uses raindrops_prev_next_post( )
* @uses comment_template( )
* @uses get_day_link( )
*/
if ( !defined( 'ABSPATH' ) ) {
exit;
}
global $template;
do_action( 'raindrops_pre_part_' . basename( __FILE__, '.php' ) . '_' . basename( $template ) );
$raindrops_date_html_module = '<a href="%1$s">%2$s</a>';
$raindrops_date_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
$raindrops_archive_year = get_the_time( 'Y' );
$raindrops_archive_month = get_the_time( 'm' );
$raindrops_archive_day = get_the_time( 'd' );
$raindrops_day_link = esc_url( get_day_link( $raindrops_archive_year, $raindrops_archive_month, $raindrops_archive_day ) . '#post-' . $post->ID
);
$raindrops_display_article_publish_date = raindrops_warehouse_clone( 'raindrops_display_article_publish_date' );
if ( 'ja' == get_locale()) {
// japanese date
$raindrops_archive_year = raindrops_year_name_filter( $raindrops_archive_year );
$raindrops_archive_month = raindrops_archive_day_filter_month( $raindrops_archive_month );
$raindrops_archive_day = raindrops_archive_day_filter_day( $raindrops_archive_day );
$raindrops_status_date = $raindrops_archive_year. $raindrops_archive_month. $raindrops_archive_day;
} else {
$raindrops_status_date = get_the_time( $raindrops_date_format );
}
if ( is_single() ) {
/**
* Template for Single post
*
*
*
*/
?>
<ul class="entry-meta-list left">
<?php if( 'show' == $raindrops_display_article_publish_date ) { ?>
<li class="category-blog-publish-date post-format-status-publish-date">
<?php
printf( $raindrops_date_html_module, $raindrops_day_link, $raindrops_status_date );
?>
</li>
<?php } ?>
<li class="blog-avatar post-format-status-avatar">
<?php
echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'raindrops_author_bio_avatar_size', 90 ), '', __( 'Author', 'raindrops' ) . ' ' . get_the_author_meta( 'display_name' )
);
?>
</li>
<li class="category">
<?php
esc_html_e( 'Category:', 'raindrops' );
the_category( ' ' )
?>
</li>
<li class="tag">
<?php
esc_html_e( 'Tags:', 'raindrops' );
the_tags( ' ', ' ' );
?>
</li>
<li class="author">
<?php
esc_html_e( 'Author:', 'raindrops' );
printf(
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() )
);
?>
</li>
<li class="comment">
<?php
if ( comments_open() ) {
comments_popup_link( esc_html__( 'Leave a comment', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), esc_html__( '1 Comment', 'raindrops' ), esc_html__( '% Comments', 'raindrops' )
);
}
?>
</li>
<?php
dynamic_sidebar( 'sidebar-5' );
?>
<li class="misc">
<?php
edit_post_link( esc_html__( 'Edit', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '<span class="edit-link">', '</span>'
);
raindrops_delete_post_link( esc_html__( 'Trash', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '<span class="edit-link">', '</span>'
);
?>
</li>
</ul>
<div class="blog-main right post-format-status-main">
<?php
raindrops_entry_title();
?>
<div class="entry-content clearfix">
<?php
raindrops_prepend_entry_content();
raindrops_entry_content();
?>
<div class="clearfix">
<?php
raindrops_append_entry_content();
?>
</div>
<?php
wp_link_pages( 'before=<p class="pagenate clearfix">&after=</p>&next_or_number=number&pagelink=<span>%</span>' );
?>
</div>
</div>
<div class="clearfix"></div>
<?php
} else {
/**
* Template for Not Single post
*
*
*
*/
?>
<div class="format-status-not-single-post">
<ul class="entry-meta-list left">
<?php if( 'show' == $raindrops_display_article_publish_date ) { ?>
<li class="category-blog-publish-date post-format-status-publish-date">
<?php
printf( $raindrops_date_html_module, $raindrops_day_link, $raindrops_status_date );
?>
</li>
<?php } ?>
<li class="blog-avatar">
<?php
$raindrops_avatar = get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'raindrops_author_bio_avatar_size', 48 ), '', get_the_author_meta( 'display_name' )
);
printf(
'<span class="author vcard"><a class="url" href="%1$s">%2$s<span class="fn n">%3$s</span></a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), $raindrops_avatar, get_the_author_meta( 'display_name' ) );
?>
</li>
</ul>
<div class="blog-main right post-format-status-main">
<?php
raindrops_entry_title();
?>
<div class="entry-content clearfix">
<?php
raindrops_prepend_entry_content();
raindrops_entry_content();
?>
<div class="clearfix">
<?php
raindrops_append_entry_content();
?>
</div>
<?php
wp_link_pages( 'before=<p class="pagenate clearfix">&after=</p>&next_or_number=number&pagelink=<span>%</span>' );
?>
</div>
</div>
<?php
if ( !is_tax() ) {
?>
<div class="entry-utility entry-meta clear"><?php
if( 'after' == raindrops_warehouse( 'raindrops_posted_on_position' ) ) {
raindrops_posted_on();
}
if( 'after' == raindrops_warehouse( 'raindrops_posted_in_position' ) ) {
raindrops_posted_in();
}
?></div>
<?php
}
if ( is_user_logged_in() && is_tax() ) {
?>
<div class="entry-utility entry-meta clear">
<?php
edit_post_link( esc_html__( 'Edit', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '<span class="edit-link">', '</span>' );
raindrops_delete_post_link( esc_html__( 'Trash', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '<span class="edit-link">', '</span>' );
?>
</div>
<?php
} elseif ( is_tax() ) {
$raindrops_date_html_module = '<p style="text-align:right;">' . $raindrops_date_html_module . '</p>';
printf( $raindrops_date_html_module, $raindrops_day_link, $raindrops_status_date );
}
?>
</div>
<?php
}
do_action( 'raindrops_after_part_' . basename( __FILE__, '.php' ) . '_' . basename( $template ) );
?>