<?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://www.ftchinese.com/" rel="nofollow">FT中文网</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://www.ftchinese.com/rss/feed');    
$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://cn.wsj.com/gb/" rel="nofollow">华尔街日报</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://cn.wsj.com/gb/rssall.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://finance.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/finance/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://money.163.com/" rel="nofollow">网易财经头条</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://money.163.com/special/00252EQ2/toutiaorss.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://cn.reuters.com/news/analyses" rel="nofollow">路透深度分析</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://cn.reuters.com/rssFeed/CNAnalysesNews/');    
$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://finance.huanqiu.com" rel="nofollow">环球网财经中国</a></div>
<ul>
<?php   
require_once (ABSPATH . WPINC . '/class-feed.php');    
$feed = new SimplePie();    
$feed->set_feed_url('http://rss.huanqiu.com/finance/china.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(); ?>