2013-04-24 34 views

回答

1

到XML源添加到您的網站,看看下面的代碼。

<?php 
include_once(ABSPATH . WPINC . '/feed.php'); 
$feed = fetch_feed(http://uk.affiliatewindow.com/feed/); 
$rss = $feed; 
if(!empty($rss)): 
$maxitems = $rss->get_item_quantity(4); 
$rss_items = $rss->get_items(0, $maxitems); 
endif; 
?> 
<?php if ($maxitems == 0) echo 'No news'; 
else 
foreach ($rss_items as $item) : ?> 

<?php 
// display item title and date 

     echo '<span class="comment_author"><a href="http://uk.affiliatewindow.com/" target="_blank">' . substr($item->get_title(), 0, 65) . '...</a></span><br>'; ?> 
     <? 
     // if single item, display content 
     if(isset($_GET['item'])) 
     { 

      echo ' <span class="latest_content"><a href="http://uk.affiliatewindow.com/" target="_blank">'. substr($item->get_content(), 0, 30).'</a></span>'; 
     } 

     echo '<span class="latest_content">' . shorten($item->get_description(), 150).'</span><br>'; 

?> 

<?php endforeach; ?> 

在這一行$feed = fetch_feed(http://uk.affiliatewindow.com/feed/);是飼料ADRESS 接下來我相信的,你現在會!

在這裏我從你想要的網站導入飼料。在側邊欄中查找外部Feed。 http://5wpthemes.com/press5/

你唯一需要做的就是設置href地址!

告訴我,如果它的工作!

+0

死鏈接 - 方便! – matpol 2016-02-12 12:07:17