Witam,
Kombinuje i kombinuje ale nie mogę przerobić skryptu tak żeby wyświetlał 5 różnych linków (u mnie to będą wiadomości ze strony)
?php if (function_exists('fetch_feed')) { ?>
<?php include_once(ABSPATH . WPINC . '/feed.php');
$feed = fetch_feed('http://www.wp.pl/rss.xml?id=1');
$limit = $feed->get_item_quantity(5);
$items = $feed->get_items(0, $limit);
if (!$items) {
} else {
foreach ($items as $item) { ?>
<?php }
} ?>
<?php } ?>
Daję kod na stronę :
<h3><a href="<?php echo $item->get_permalink(); ?>">
<?php echo truncateWords($item->get_title(),10),"..."; ?>
</a></h3><br clear="all"> <a href="<?php echo $item->get_permalink(); ?>">
<?php echo truncateWords($item->get_title(),10),"..."; ?>
</a><br clear="all"> <a href="<?php echo $item->get_permalink(); ?>">
<?php echo truncateWords($item->get_title(),10),"..."; ?>
</a><br clear="all"> <a href="<?php echo $item->get_permalink(); ?>">
<?php echo truncateWords($item->get_title(),10),"..."; ?>
</a><br clear="all"> <a href="<?php echo $item->get_permalink(); ?>">
<?php echo truncateWords($item->get_title(),10),"..."; ?>
</a><br clear="all">
Ale w morde kopane wyświetla pięć identycznych wiadomości!!
Jak to przerobic?
Z góry dzięki za odpowiedź.