golfnews/golfweekly

[php]
$limit = 0;
if(function_exists(‘fetch_feed’)) {
include_once(ABSPATH . WPINC . ‘/feed.php’); // the file to rss feed generator
$feed = fetch_feed(‘http://www.golfsite.nl/rss/nieuws’); // specify the rss feed
}
if ( is_wp_error( $feed ) ) { // Checks that the object is created incorrectly
echo ‘[div]Er is op dit moment geen nieuws van Golfnews/Golfweekly ![/div]’;
}
if ( ! is_wp_error( $feed ) ) {

$limit = $feed->get_item_quantity(4); // specify number of items
$items = $feed->get_items(0, $limit); // create an array of items

if ($limit == 0) echo ‘[div]Er is tijdelijk geen nieuws . . . [/div]’;
else

foreach ($items as $item) {
$lynk = ‘[a href=”‘ . $item->get_permalink() . ‘” target=”_blank” alt=”‘ . $item->get_title() . ‘”]’ . $item->get_title() . ‘[/a] – ‘;
$dtekst = ‘[span style=”font-size: 9px;”]’ . $item->get_date(‘j F Y @ g:i a’) . ‘[/span]’;
$btekst = substr($item->get_description(), 0, 220) . ‘. . . ‘;
$br = strpos($btekst, ‘br /’);
$end = $br + (-1);
$ptekst = substr($btekst, 0, $end);
$etekst = substr($btekst, $br + 5);
echo ‘[div style=”float: left; padding-right: 32px;”]’ . $ptekst . ‘[/div]’;
echo $lynk;
echo $dtekst . ‘[br /]’;
echo $etekst . ‘[br /][br /]’;
echo ‘[hr]’;
}
}
[/php]

Meer golfnieuws: klik hier.golf.nl