<h2 class="stringent">
<?php echo get_post_meta($post->ID, "Company", true) ?> Persistant Search</h2>
<?php // Get RSS Feed(s)
$org = get_post_meta($post->ID, "Company", true);
//print $org;
if ($org) {
include_once(ABSPATH . WPINC . '/rss.php');
$url = 'http://api.search.yahoo.com/WebSearchService/rss/webSearch.xml?appid=yahoosearchwebrss&query='. urlencode($org) . '+africa&adult_ok=1';
$rss = fetch_rss($url);
$maxitems = 10;
$items = array_slice($rss->items, 0, $maxitems);
foreach ( $items as $item ) :
$title = substr($item['title'],0,55)."... ";
?>
<ul>
<li><a href='<?php echo $item['link']; ?>' title='<?php echo $item['description']; ?>'>
<?php print $title; ?>
</a></li>
</ul>

<?php endforeach; 

}
?>

<br /><br />
	
<h2 class="stringent"><?php echo get_post_meta($post->ID, "Company", true); ?> Blogstream</h2>

<?php // Get RSS Feed(s)

$feed = get_post_meta($post->ID, "Feed1", true); 
// print $feed;

if ($feed) {

include_once(ABSPATH . WPINC . '/rss.php');
 $url = $feed;
// print $url;
	$rss = fetch_rss($feed);
 if ($rss == false){ 
    $string .= "[No Feed To Retrieve]"; 
    return $string; 
 }
$maxitems = 10;
$items = array_slice($rss->items, 0, $maxitems);
foreach ( $items as $item ) :
// define the string which is '$title'
// define the action 'substr' means sub-string or 'part of a string'
// define where the feed string starts - first letter is '0'
// define the length of the feed string - 55 characters
// define the trailing characters - "..." 
$title = substr($item['title'],0,55)." ... ";
?>
<ul>
<li><a href='<?php echo $item['link']; ?>' title='<?php echo $item['description']; ?>'>
<?php print $title; ?>
</a></li>
</ul>

<?php endforeach; 

}
?>
<br /><br />
