|
1 |
| -<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
| 1 | +<?php if (!defined('__TYPECHO_ROOT_DIR__')) { |
| 2 | + exit; |
| 3 | +} ?> |
2 | 4 | <?php $this->need('page_header.php'); ?>
|
3 | 5 | <main class="layout" id="content-inner">
|
4 | 6 | <div class="recent-posts category_ui" id="recent-posts">
|
5 | 7 | <?php if ($this->have()): ?>
|
6 |
| - <?php while($this->next()): ?> |
| 8 | + <?php while ($this->next()): ?> |
7 | 9 | <div class="recent-post-item">
|
8 |
| - <wehao class="post_cover"> |
9 |
| - <a class="article-title" href="<?php $this->permalink() ?>"> |
10 |
| - <img class="post-bg" data-lazy-src="<?php echo get_ArticleThumbnail($this);?>" src="<?php echo GetLazyLoad() ?>" onerror="this.onerror=null;this.src='<?php $this->options->themeUrl('img/404.jpg'); ?>'"></a> |
11 |
| - </wehao> |
12 |
| - <div class="recent-post-info"> |
13 |
| - <a class="article-title" href="<?php $this->permalink() ?>"><?php $this->title() ?></a> |
| 10 | + <?php if(noCover($this)): ?> |
| 11 | + <wehao class="post_cover"> |
| 12 | + <a href="<?php $this->permalink() ?>"> |
| 13 | + <img class="post-bg" data-lazy-src="<?php echo get_ArticleThumbnail($this);?>" src="<?php echo GetLazyLoad() ?>" onerror="this.onerror=null;this.src='<?php $this->options->themeUrl('img/404.jpg'); ?>'"></a> |
| 14 | + </wehao> |
| 15 | + <?php endif ?> |
| 16 | + <div class="recent-post-info<?php echo noCover($this) ? '' : ' no-cover'; ?>"> |
| 17 | + <a class="article-title" href="<?php $this->permalink(); ?>"><?php $this->title(); ?></a> |
14 | 18 | <div class="article-meta-wrap">
|
15 |
| - <?php $this->sticky();?> |
| 19 | + <?php $this->sticky(); ?> |
16 | 20 | <span class="post-meta-date" style="display:none;">
|
17 | 21 | <i class="far fa-calendar-alt"></i>
|
18 | 22 | <?php _e('发表于 '); ?> <?php $this->date(); ?>
|
|
21 | 25 | </span>
|
22 | 26 | <i class="fas fa-history"></i>
|
23 | 27 | <span class="article-meta-label">更新于</span>
|
24 |
| - <?php echo date('Y-m-d' , $this->modified);?> |
25 |
| - <time class="post-meta-date-updated" datetime="<?php echo date('Y-m-d' , $this->modified);?>" title="更新于 "> |
| 28 | + <?php echo date('Y-m-d', $this->modified); ?> |
| 29 | + <time class="post-meta-date-updated" datetime="<?php echo date('Y-m-d', $this->modified); ?>" title="更新于 "> |
26 | 30 | </time>
|
27 | 31 | <span class="article-meta">
|
28 | 32 | <span class="article-meta__separator">|</span>
|
|
41 | 45 | <span class="article-meta__separator">|</span>
|
42 | 46 | <i class="fas fa-comments"></i>
|
43 | 47 | <span class="post-meta-date" itemprop="interactionCount">
|
44 |
| - <a itemprop="discussionUrl" href="<?php $this->permalink() ?>#comments"> |
| 48 | + <a itemprop="discussionUrl" href="<?php $this->permalink(); ?>#comments"> |
45 | 49 | <?php $this->commentsNum('0条评论', '1 条评论', '%d 条评论'); ?>
|
46 | 50 | </a>
|
47 | 51 | </span>
|
48 | 52 | </span>
|
49 | 53 | </div>
|
50 | 54 | <div class="content">
|
51 |
| - <?php if($this->fields->excerpt && $this->fields->excerpt!='') { |
52 |
| - echo $this->fields->excerpt; |
53 |
| - }else{ |
54 |
| - echo $this->excerpt(130); |
55 |
| - } |
56 |
| - echo '<br><br><a href="',$this->permalink(),'" title="',$this->title(),'">阅读全文...</a>'; |
57 |
| - ?> |
| 55 | + <?php if ($this->fields->excerpt && $this->fields->excerpt != '') { |
| 56 | + echo $this->fields->excerpt; |
| 57 | +} else { |
| 58 | + echo $this->excerpt(130); |
| 59 | +} |
| 60 | + echo '<br><br><a href="',$this->permalink(),'" title="',$this->title(),'">阅读全文...</a>'; |
| 61 | + ?> |
58 | 62 | </div>
|
59 | 63 | </div>
|
60 | 64 | </div>
|
|
65 | 69 | </article>
|
66 | 70 | <?php endif; ?>
|
67 | 71 | <nav id="pagination">
|
68 |
| - <?php $this->pageNav('<i class="fas fa-chevron-left fa-fw"></i>', '<i class="fas fa-chevron-right fa-fw"></i>', 1, '...', array('wrapTag' => 'div', 'wrapClass' => 'pagination', 'itemTag' => '', 'prevClass' => 'extend prev', 'nextClass' => 'extend next', 'currentClass' => 'page-number current' )); ?> |
| 72 | + <?php $this->pageNav('<i class="fas fa-chevron-left fa-fw"></i>', '<i class="fas fa-chevron-right fa-fw"></i>', 1, '...', ['wrapTag' => 'div', 'wrapClass' => 'pagination', 'itemTag' => '', 'prevClass' => 'extend prev', 'nextClass' => 'extend next', 'currentClass' => 'page-number current']); ?> |
69 | 73 | </nav>
|
70 | 74 | </div><!-- end #main -->
|
71 | 75 | <?php $this->need('sidebar.php'); ?>
|
|
0 commit comments