content-image.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Akina
  8. */
  9. ?>
  10. <article class="post post-list" itemscope="" itemtype="http://schema.org/BlogPosting">
  11. <div class="post-entry">
  12. <div class="feature">
  13. <?php if ( has_post_thumbnail() ) { ?>
  14. <a href="<?php the_permalink();?>"><div class="overlay"><i class="fa-solid fa-box-archive"></i></div><?php the_post_thumbnail(); ?></a>
  15. <?php } else {?>
  16. <a href="<?php the_permalink();?>"><div class="overlay"><i class="fa-solid fa-box-archive"></i></div><img src="<?=iro_opt('vision_resource_basepath')?>basic/content-image-<?php echo rand(1,4)?>.jpg" /></a>
  17. <?php } ?>
  18. </div>
  19. <h1 class="entry-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h1>
  20. <div class="p-time">
  21. <?php if(is_sticky()) : ?>
  22. <i class="fa-regular fa-gem"></i>
  23. <?php endif ?>
  24. <i class="fa-regular fa-clock"></i><?php echo poi_time_since(strtotime($post->post_date));//the_time('Y-m-d');?>
  25. </div>
  26. <p><?php echo mb_strimwidth(strip_shortcodes(strip_tags(apply_filters('the_content', $post->post_content))), 0, 150,"...");?></p>
  27. <footer class="entry-footer">
  28. <div class="info-meta">
  29. <div class="comnum">
  30. <span><i class="fa-regular fa-comment"></i>
  31. <?php comments_popup_link(__("NOTHING","sakurairo"), __("1 Comment","sakurairo")/*条评论*/, '% '.__("Comments","sakurairo")/*条评论*/,'',__("Comment Closed","sakurairo")/**评论关闭 */); ?>
  32. </span>
  33. </div>
  34. <div class="views">
  35. <span><i class="fa-regular fa-eye"></i><?php echo get_post_views(get_the_ID()).' '._n('Hit','Hits',get_post_views(get_the_ID()),'sakurairo')/*热度*/?></span>
  36. </div>
  37. </div>
  38. </footer><!-- .entry-footer -->
  39. </div>
  40. <hr>
  41. </article><!-- #post-## -->