PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/AesRoom/archive.php

https://github.com/kikaendeavor/wordpress
PHP | 113 lines | 96 code | 10 blank | 7 comment | 10 complexity | e8e36cb074729e170ffc510b528ac672 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php get_header(); ?>
  2. <div class="s_position">
  3. <i class="lt"></i>
  4. <i class="rt"></i>
  5. <i class="lb"></i>
  6. <i class="rb"></i>
  7. <?php
  8. // If this is a category archive
  9. if (is_category()) {
  10. printf("<h3>栏目:
  11. <span class='cate_spe'>".single_cat_title('', false)."</span> 下的所有文章</h3>" );
  12. if (category_description()) echo '<p>'.category_description().'</p>';
  13. // If this is a tag archive
  14. } elseif (is_tag()) {
  15. printf("<h3>标签:
  16. <span class='cate_spe'>".single_tag_title('', false).'</span> 下的所有文章</h3>' );
  17. if (tag_description()) echo '<p>'.tag_description().'</p>';
  18. // If this is a daily archive
  19. } elseif (is_day()) {
  20. printf('<h3>
  21. '.get_the_time('Y年n月j日').'</h3>' );
  22. // If this is a monthly archive
  23. } elseif (is_month()) {
  24. printf('<h3>
  25. '.get_the_time('Y年n月').'</h3>' );
  26. // If this is a yearly archive
  27. } elseif (is_year()) {
  28. printf('<h3>
  29. '.get_the_time('Y年').'</h3>' );
  30. // If this is an author archive
  31. } elseif (is_author()) {
  32. echo '作者存档';
  33. // If this is a paged archive
  34. } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
  35. echo '博客存档';
  36. }
  37. ?>
  38. </div>
  39. <?php
  40. if (have_posts()) : while (have_posts()) : the_post(); ?>
  41. <!-- Blog Post -->
  42. <div class="post-box">
  43. <i class="lt"></i>
  44. <i class="rt"></i>
  45. <i class="lb"></i>
  46. <i class="rb"></i>
  47. <div class="post-head">
  48. <div class="post-title">
  49. <h2><a href="<?php the_permalink(); ?>" title="点击查看 <?php the_title(); ?> 链接:"><?php the_title(); ?></a></h2>
  50. <span class="comment_span"><?php comments_popup_link( "<span class='leave-reply'>" . __( '沙发空缺', 'san-kloud' ) . "</span>", __( '评论:1条', 'san-kloud' ), __( '评论:%条', 'san-kloud' ) ); ?></span>
  51. </div>
  52. <div class="post-img">
  53. <?php if ( has_post_thumbnail() ) { ?>
  54. <?php the_post_thumbnail(); ?>
  55. <?php } else {?>
  56. <img src="<?php bloginfo('template_url'); ?>/images/<?php echo rand(1,6)?>.jpg" />
  57. <?php } ?>
  58. </div>
  59. <div class="post-content">
  60. <p>
  61. <?php $content=get_the_content();
  62. if(strpos($content,"embed")){
  63. $first = stripos($content,"embed");
  64. $end = strripos($content,"</object>");
  65. $c = substr($content,$first,$end-$first-1);
  66. $embedPath = "<".$c.">";
  67. echo "<style>
  68. .post-box embed{
  69. width:520px;
  70. height:300px;
  71. }
  72. .post-content{
  73. height:auto ;
  74. }
  75. </style><div style='display:none'>".$embedPath."</div>"."<img src='http://www.dwlxjz.com/wp-content/themes/AesRoom/images/embed.png' title='点击播放视频' width='500px' height='150px' onclick='ceshi(this)'/>";
  76. }else{
  77. echo mb_strimwidth(strip_tags(apply_filters('the_excerpt', $post->post_content)), 0, 400,"...");
  78. }
  79. ?>
  80. </p>
  81. </div>
  82. </div>
  83. <div class="post-bottom">
  84. <div class="post-time">
  85. <span><?php the_time('Y-m-d'); ?></span>
  86. </div>
  87. <div class="post-infos">
  88. <span class="tags"><?php the_tags('','&nbsp;'); ?></span><span class="cate"><?php the_category('&nbsp;') ?></span>
  89. <div class="post-readmore">
  90. <a href="<?php the_permalink() ?>" title="链接至文章正文!">阅读全文</a>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <?php endwhile; ?>
  96. <?php pagination($query_string); ?>
  97. <?php else : ?>
  98. <h1 class="title"><a href="#" rel="bookmark">未找到</a></h1>
  99. <p>没有找到任何文章</p>
  100. <?php endif; ?>
  101. </div>
  102. <?php get_sidebar(); ?>
  103. <?php get_footer(); ?>