wp_rss [ WordPress Function ]
wp_rss ( $url, $num_items = -1 )
| Parameters: |
|
| Defined at: |
|
Display all RSS items in a HTML ordered list.
Source
<?php
function wp_rss( $url, $num_items = -1 ) {
if ( $rss = fetch_rss( $url ) ) {
echo '<ul>';
if ( $num_items !== -1 ) {
$rss->items = array_slice( $rss->items, 0, $num_items );
}
foreach ( (array) $rss->items as $item ) {
printf(
'<li><a href="%1$s" title="%2$s">%3$s</a></li>',
esc_url( $item['link'] ),
esc_attr( strip_tags( $item['description'] ) ),
esc_html( $item['title'] )
);
}
echo '</ul>';
} else {
_e( 'An error has occurred, which probably means the feed is down. Try again later.' );
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/wp rss « WordPress Codex
This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions.
codex.wordpress.org - WordPress › Support » Tags — wp_rss
(forgot?) Register · WordPress › Support » wp_rss ... [resolved] Replacement for wp_rss, 2, Saronsongs, 1 year. wp_rss shows gremlins, 3, carpenoctem, 2 years ...
wordpress.org - How to: Display any rss feed on your WordPress blog
Jul 27, 2011 ... Do you know that WordPress have a function, called wp_rss(), which is nothing else than a built-in rss reader? Here's the simple code to add ...
www.wprecipes.com - 5 Useful WordPress Functions You Didn't Know Existed - Nathan Rice
Jun 3, 2009 ... You can check out the function reference for wp_rss() here, or get_rss() here, or you can view the source code for each of the functions here.
www.nathanrice.net
Gebruikersdiscussies [ wordpress.org ]
- Saronsongs on "Replacement for wp_rss"
- Saronsongs on "Replacement for wp_rss"
- carpenoctem on "wp_rss shows gremlins"
- kmessinger on "Problem importing an RSS feed into my Wordpress blog"
- babypress on "Problem importing an RSS feed into my Wordpress blog"
- wasnotwas on "Problem importing an RSS feed into my Wordpress blog"
- kmessinger on "Problem importing an RSS feed into my Wordpress blog"
- wasnotwas on "Problem importing an RSS feed into my Wordpress blog"
- kmessinger on "Problem importing an RSS feed into my Wordpress blog"
- wasnotwas on "Problem importing an RSS feed into my Wordpress blog"