<?php
/*
Template Name:体育聚合页面
*/
?>
<?php get_header(); ?>
<div id="main">
<div id="page-box">
<?php if(have_posts()) : while(have_posts()) : the_post() ?>
<div id="htit">
<h2>
<?php the_title(); ?>
</h2>
</div>
<?php the_content(); ?>
<div id="rsscon">
<div class=rss_box>
<div class="rss_tit"><a href="http://sports.163.com/nba/" rel="nofollow">网易NBA</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://sports.163.com/special/00051K7F/rss_sportslq.xml');    
$feed->enable_order_by_date(false);    
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');    
$feed->init();    
$feed->handle_content_type();    
?>
<?php foreach ($feed->get_items(0,10) as $item): ?>
<li><a href="<?php echo $item->get_permalink()?>" rel="nofollow"><?php echo $item->get_title()?></a>
<?php endforeach; ?>
</li>
</ul>
</div>
<div class=rss_box>
<div class="rss_tit"><a href="http://cbachina.163.com/" rel="nofollow">网易CBA</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://sports.163.com/special/00051K7F/rss_sportscba.xml');    
$feed->enable_order_by_date(false);    
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');    
$feed->init();    
$feed->handle_content_type();    
?>
<?php foreach ($feed->get_items(0,10) as $item): ?>
<li><a href="<?php echo $item->get_permalink()?>" rel="nofollow"><?php echo $item->get_title()?></a>
<?php endforeach; ?>
</li>
</ul>
</div>
<div class=rss_box>
<div class="rss_tit"><a href="http://sports.163.com/yc/" rel="nofollow">网易英超</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://sports.163.com/special/00051K7F/rss_sportsyc.xml');    
$feed->enable_order_by_date(false);    
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');    
$feed->init();    
$feed->handle_content_type();    
?>
<?php foreach ($feed->get_items(0,10) as $item): ?>
<li><a href="<?php echo $item->get_permalink()?>" rel="nofollow"><?php echo $item->get_title()?></a>
<?php endforeach; ?>
</li>
</ul>
</div>
<div class=rss_box>
<div class="rss_tit"><a href="http://sports.163.com/yj/" rel="nofollow">网易意甲</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://sports.163.com/special/00051K7F/rss_sportsyj.xml');    
$feed->enable_order_by_date(false);    
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');    
$feed->init();    
$feed->handle_content_type();    
?>
<?php foreach ($feed->get_items(0,10) as $item): ?>
<li><a href="<?php echo $item->get_permalink()?>" rel="nofollow"><?php echo $item->get_title()?></a>
<?php endforeach; ?>
</li>
</ul>
</div>
<div class=rss_box>
<div class="rss_tit"><a href="http://sports.sina.com.cn/" rel="nofollow">新浪体育要闻</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://rss.sina.com.cn/roll/sports/hot_roll.xml');    
$feed->enable_order_by_date(false);    
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');    
$feed->init();    
$feed->handle_content_type();    
?>
<?php foreach ($feed->get_items(0,10) as $item): ?>
<li><a href="<?php echo $item->get_permalink()?>" rel="nofollow"><?php echo $item->get_title()?></a>
<?php endforeach; ?>
</li>
</ul>
</div>
<div class=rss_box>
<div class="rss_tit"><a href="http://sports.qq.com/photo" rel="nofollow">腾讯体育图片</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://sports.qq.com/photo/rss_photo.xml');    
$feed->enable_order_by_date(false);    
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');    
$feed->init();    
$feed->handle_content_type();    
?>
<?php foreach ($feed->get_items(0,10) as $item): ?>
<li><a href="<?php echo $item->get_permalink()?>" rel="nofollow"><?php echo $item->get_title()?></a>
<?php endforeach; ?>
</li>
</ul>
</div>
</div>
<?php endwhile; endif; ?>
<div id="tj">
<?php the_views(); ?>
</div>
<div id="qr"><img src="https://chart.googleapis.com/chart?cht=qr&chs=76x76&choe=UTF-8&chld=L|0&chl=<?php the_permalink() ?>"><span>本页二维码</span></div>
</div>
</div>
<?php get_footer(); ?>