I'm using fetch_feed (based on Simplepie) to display an array of RSS feeds (favicon & headlines only). Documentation on the simplepie website says to use get_favicon in the stylesheet. And I'm using the fetch_feed codex example. I'm getting the spacing where the favicon should be but not the favicon. The feed links appear fine.
CSS:
.rss a {
padding:0 0 0 20px;
background:transparent url(<?php echo esc_url ( $item->get_favicon() ); ?>) no-repeat 0 1px;
}
PHP:
<h2><?php _e('Recent news from Some-Other Blog:'); ?></h2>
<?php // Get RSS Feed(s)
// include_once(ABSPATH . WPINC . '/feed.php');
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed(array('http://wordpress.org/news/feed/','http://beernews.org/feed/'));
if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 5.
$maxitems = $rss->get_item_quantity(20);
// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems);
endif;
?>
<ul style="list-style-type: none;">
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<a class='rss' href='<?php echo esc_url( $item->get_permalink() ); ?>' title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
<?php echo esc_html( $item->get_title() ); ?>
</a>
<?php echo '<hr/>'; ?>
</li>
<?php endforeach; ?>
</ul>