是的,@toscho是对的url
使用一组提要地址。如果你有5/6个feed,那么项目总数应该是20/24。
为了实现清晰的分离,我认为最好运行wp_widget_rss_output
作用n
并准备一个包含标题和地址的前一个数组,然后遍历它。滚动问题只是CSS的问题。
add_action( \'wp_dashboard_setup\', \'multiple_feeds_wpse_91027\' );
function multiple_feeds_wpse_91027()
{
wp_add_dashboard_widget(
\'dashboard_custom_feed\',
\'Latest News\',
\'dashboard_feed_output_wpse_91027\'
);
}
function dashboard_feed_output_wpse_91027()
{
// Array with Title => Address
$feeds = array(
\'First Feed\' => \'http://example.com/feed\',
\'Second Feed\' => \'http://example2.com/rss\',
\'Third Feed\' => \'http://example3.com/feed/\',
);
// Set max-height and enable scrolling
echo \'<div style="max-height:300px;overflow-y:auto">\';
foreach( $feeds as $key => $value )
{
echo "<h3>$key</h3>";
wp_widget_rss_output(array(
\'url\' => $value,
\'items\' => 4,
\'show_summary\' => 1
));
}
echo "</div>";
}