-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-archive.php
56 lines (46 loc) · 2.41 KB
/
content-archive.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
<?php
$title = esc_html(get_the_title());
$excerpt = apply_filters( 'the_excerpt', get_the_excerpt() );
if( is_search() ){
$keyword = get_search_query();
$title = dmeng_highlight_keyword($keyword, $title);
$excerpt = dmeng_highlight_keyword($keyword, $excerpt);
}
$panel_class = 'panel panel-default archive';
if( $post->post_status!='publish' )
$panel_class .= ' text-muted';
?>
<article id="post-<?php the_ID(); ?>" class="sdarticle <?php echo apply_filters('dmeng_archive_post_panel_class', $panel_class);?>" data-post-id="<?php the_ID(); ?>" role="article" itemscope itemtype="http://schema.org/Article">
<?php
$thumbnail_html = $has_thumbnail_class = '';
$thumbnail = dmeng_get_the_thumbnail();
if($thumbnail){
$thumbnail_html = '<div class="entry-thumbnail"><a href="'.get_permalink().'" title="'.get_the_title().'"><img src="'.dmeng_script_uri('grey_png').'" data-original="'.$thumbnail.'" alt="'.get_the_title().'"></a></div>';
$has_thumbnail_class = ' has_post_thumbnail';
}
?>
<div class="panel-body<?php echo $has_thumbnail_class;?>">
<?php if($thumbnail_html) echo $thumbnail_html;?>
<div class="entry-header page-header">
<h3 class="entry-title h4">
<?php
echo apply_filters( 'dmeng_the_title', '<a href="'.get_permalink().'" rel="bookmark" itemprop="url"><span itemprop="name">'.$title.'</span></a>' );
if( is_sticky() )
echo ' '.apply_filters( 'dmeng_sticky_label', '<span class="label label-danger">'.__('置顶','dmeng').'</span>');
?>
</h3>
<?php
if( $post->post_status!='publish' ){
$meta_output = '<div class="entry-meta">';
if( $post->post_status==='pending' ) $meta_output .= sprintf(__('正在等待审核,你可以 <a href="%1$s">预览</a> 或 <a href="%2$s" data-no-instant>重新编辑</a> 。','dmeng'), get_permalink(), get_edit_post_link() );
if( $post->post_status==='draft' ) $meta_output .= sprintf(__('这是一篇草稿,你可以 <a href="%1$s">预览</a> 或 <a href="%2$s" data-no-instant>继续编辑</a> 。','dmeng'), get_permalink(), get_edit_post_link() );
$meta_output .= '</div>';
echo $meta_output;
}else{
gd_post_meta();
}
?>
</div>
<div class="entry-content" itemprop="description" data-no-instant><?php echo $excerpt;?></div>
</div>
</article><!-- #content -->