File: /www/wwwroot/doba123.com/wp-content/themes/duba2/single-news.php
<?php
/*
Template Name: 新闻详情
Author: 畔游科技
Version: 1.0
*/
get_header(); ?>
<div class="pg-banner">
<picture>
<img src="<?php echo of_get_option( 'banner_news'); ?>">
</picture>
</div>
<!-- ./banner -->
<div class="container-width">
<div class="cate-path">
<img src="<?php bloginfo('template_url'); ?>/images/path-ico.jpg"> <em>您当前的位置:</em><a href="/">首页</a> <b>></b> <?php the_category(" > "); ?> <b>></b> <span><?php the_title(); ?></span>
</div>
</div>
<!-- ./path -->
<!---------------- main ---------------->
<div class="container-width clearfix">
<div class="show-left">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="show-title">
<h3><?php the_title(); ?></h3>
<div class="show-info">
<span>发布时间:<?php the_time('Y-m-d'); ?></span>
<span>来源:度巴DOBA</span>
<span>浏览次数:<?php get_post_views($post -> ID); ?>次</span>
</div>
</div>
<!-- ./title -->
<div class="show-content">
<?php the_content(); ?>
</div>
<div class="show-share clearfix">
分享到:
<div class="bshare-custom fr">
<a title="分享到QQ空间" class="bshare-qzone"></a>
<a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
<a title="分享到人人网" class="bshare-renren"></a>
<a title="分享到腾讯微博" class="bshare-qqmb"></a>
<a title="分享到网易微博" class="bshare-neteasemb"></a>
<!-- <a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a> -->
<!-- <span class="BSHARE_COUNT bshare-share-count">0</span> -->
</div>
</div>
<hr class="hr">
<!-- ./content -->
<div class="pg-view">
<ul class="clearfix">
<?php
$categories = get_the_category();
$categoryIDS = array();
foreach ($categories as $category) {
array_push($categoryIDS, $category->term_id);
}
$categoryIDS = implode(",", $categoryIDS);
?>
<li class="py_next"><?php if (get_next_post($categoryIDS)) { next_post_link('上一篇: %link','%title',true);} else { echo "已是最新文章";} ?></li>
<li class="py_previou"><?php if (get_previous_post($categoryIDS)) { previous_post_link('下一篇: %link','%title',true);} else { echo "已是最后文章";} ?></li>
</ul>
</div>
<?php endwhile; endif; ?>
<!-- ./ -->
<h3 class="articlelink-title"><span>相关推荐</span></h3>
<div class="articlelink">
<ul class="clearfix">
<?php $posts = query_posts('cat=1&showposts=8&order=DESC&orderby=date' . '&paged=' . get_query_var('paged'));
if ($posts) : foreach( $posts as $post ) : setup_postdata( $post );{?>
<li><a href="<?php the_permalink(); ?>"><i>></i> <?php the_title(); ?></a></li>
<?php } endforeach; endif; wp_reset_query(); ?>
</ul>
</div>
</div>
<!-- ./left -->
<div class="show-right">
<h3 class="show-hotitle"><span> 热门推荐</span></h3>
<div class="show-hot">
<ul>
<?php $posts = query_posts('cat=1&showposts=8&order=DESC&orderby=date' . '&paged=' . get_query_var('paged'));
if ($posts) : foreach( $posts as $post ) : setup_postdata( $post );{?>
<li>
<a href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
<p><img src="<?php bloginfo('template_url'); ?>/images/ico-time.png"> <?php the_time('Y-m-d'); ?></p>
</a>
</li>
<?php } endforeach; endif; wp_reset_query(); ?>
</ul>
</div>
</div>
<!-- ./right -->
</div>
<script charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=2&lang=zh"></script>
<script charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
<!---------------- main ---------------->
<?php get_footer(); ?>