excerpt.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php if( dopt('d_adindex_02_b') ) printf('<div class="banner banner-sticky">'.dopt('d_adindex_02').'</div>'); ?>
  2. <?php if(is_home()&& dopt('hot_list_check') ){ ?>
  3. <div><div class="left-ad" style="clear: both;background-color: #fff; width: 30%;float: left;margin-right:2%;"></div><div class="hot-posts">
  4. <h2 class="title"><?php echo dopt('hot_list_title') ?></h2>
  5. <ul><?php hot_posts_list($days=dopt('hot_list_date'), $nums=dopt('hot_list_number')); ?></ul>
  6. </div></div>
  7. <?php } ?>
  8. <?php if (wp_is_mobile() ): ?><?php if( dopt('Mobiled_adindex_02_b') ) printf('<div class="banner-sticky">'.dopt('Mobiled_adindex_02').'</div>'); ?><?php endif ;?>
  9. <?php
  10. $_author = dopt('d_post_author_b');
  11. $_time = dopt('d_post_time_b');
  12. $_views = dopt('d_post_views_b');
  13. $_comment = dopt('d_post_comment_b');
  14. $_like = dopt('d_post_like_b');
  15. ?>
  16. <?php while ( have_posts() ) : the_post(); ?>
  17. <?php if (is_home() && in_category('49') ) continue; ?>
  18. <?php
  19. $_thumbnail = false;
  20. if( has_post_thumbnail() || !dopt('d_thumbnail_b') ){
  21. $_thumbnail = true;
  22. }
  23. ?>
  24. <article class="excerpt<?php echo !$_thumbnail ? ' excerpt-nothumbnail' : '' ?>">
  25. <header><?php if( !is_category() ) {$category = get_the_category();
  26. if($category[0]){echo '<a class="label label-important" href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'<i class="label-arrow"></i></a>';}
  27. };?><h2><a target="_blank" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
  28. <?php $t1=$post->post_date;
  29. $t2=date("Y-m-d H:i:s");
  30. $diff=(strtotime($t2)-strtotime($t1))/3600;
  31. if($diff<12){echo '<img src="'.get_bloginfo("template_url").'/img/new.gif" alt="24小时内最新">';}?> </a></h2>
  32. </header>
  33. <?php if( $_thumbnail ){ ?>
  34. <div class="focus"><a target="_blank" href="<?php the_permalink(); ?>"><img class="thumb" src="<?php echo get_bloginfo("template_url") ?>/timthumb.php?src=<?php echo post_thumbnail_src(); ?>&h=123&w=200&q=90&zc=1&ct=1" alt="<?php the_title(); ?>" /></a></div>
  35. <?php } ?>
  36. <span class="note"> <?php echo deel_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 140, '...'); ?></span>
  37. <p class="auth-span">
  38. <?php if( !is_author() && !$_author ){ ?>
  39. <span class="muted"><i class="fa fa-user"></i> <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ) ?>"><?php echo get_the_author() ?></a></span>
  40. <?php } ?>
  41. <?php if( !$_time ){ ?><span class="muted"><i class="fa fa-clock-o"></i> <?php echo timeago( get_gmt_from_date(get_the_time('Y-m-d G:i:s')) ) ?></span><?php } ?>
  42. <?php if( !$_views ){ ?><span class="muted"><i class="fa fa-eye"></i> <?php deel_views('℃'); ?></span><?php } ?>
  43. <?php if( !$_comment ){ ?><span class="muted"><i class="fa fa-comments-o"></i> <?php
  44. if ( comments_open() ) echo '<a target="_blank" href="'.get_comments_link().'">'.get_comments_number('0', '1', '%').'评论</a>'
  45. ?></span><?php } ?>
  46. <?php if( !$_like ){ ?><span class="muted">
  47. <a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" id="Addlike" class="action<?php if(isset($_COOKIE['bigfa_ding_'.$post->ID])) echo ' actived';?>"><i class="fa fa-heart-o"></i><span class="count"><?php if( get_post_meta($post->ID,'bigfa_ding',true) ){ echo get_post_meta($post->ID,'bigfa_ding',true); } else {echo '0';}?></span>喜欢</a></span><?php } ?></p>
  48. </article>
  49. <?php endwhile; wp_reset_query(); ?>
  50. <?php deel_paging(); ?>