content-single.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Sakurairo
  8. */
  9. $post_id = get_the_ID();
  10. $ai_excerpt = get_post_meta($post_id, POST_METADATA_KEY, true);
  11. ?>
  12. <?php
  13. $post = get_post();
  14. if (iro_opt('article_auto_toc', 'true') && check_title_tags($post->post_content)) {
  15. echo '<div class="has-toc have-toc"></div>';
  16. }
  17. ?>
  18. <article id="post-<?php echo esc_attr($post_id); ?>" <?php post_class(); ?>>
  19. <?php if (should_show_title()) {
  20. get_template_part('tpl/single-entry-header');
  21. } ?>
  22. <!--<div class="toc-entry-content">--><!-- 套嵌目录使用(主要为了支援评论)-->
  23. <?php if ($ai_excerpt) { ?>
  24. <div class="ai-excerpt">
  25. <h4><i class="fa-solid fa-atom"></i><?php esc_html_e("AI Excerpt", "sakurairo"); ?></h4><?php echo esc_html($ai_excerpt); ?>
  26. </div>
  27. <?php } ?>
  28. <div class="entry-content">
  29. <?php the_content('', true); ?>
  30. <?php
  31. wp_link_pages(array(
  32. 'before' => '<div class="page-links">' . esc_html__('Pages:', 'ondemand'),
  33. 'after' => '</div>',
  34. ));
  35. ?>
  36. <!--<div class="oshimai"></div>-->
  37. <!--<h2 style="opacity:0;max-height:0;margin:0">Comments</h2>--><!-- 评论跳转标记 -->
  38. </div><!-- .entry-content -->
  39. <?php get_template_part('tpl/section-article-function'); ?>
  40. </article><!-- #post-## -->