Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!is_wp_error( $rss ) ) {
- // Checks that the object is created correctly
- // Figure out how many total items there are, but limit it to $feed_items.
- $maxitems = $rss->get_item_quantity($feed_items);
- // Build an array of all the items, starting with element 0 (first element).
- $rss_items = $rss->get_items(0, $maxitems);
- }
- $output .='<ul>';
- if ($maxitems == 0) {
- $output .= '<li>' . __("No News.","techozoic") . '</li>';
- } else {
- // Loop through each feed item and display each item as a hyperlink.
- foreach ( $rss_items as $item ) {
- $output .= "<li>
- <a href='{$item->get_permalink()}'>
- {$item->get_title()}</a>
- </li>";
- }
- $output.='</ul>';
- }
- // Change above code to this code.
- if (!is_wp_error( $rss ) ) {
- // Checks that the object is created correctly
- // Figure out how many total items there are, but limit it to $feed_items.
- $maxitems = $rss->get_item_quantity($feed_items);
- // Build an array of all the items, starting with element 0 (first element).
- $rss_items = $rss->get_items(0, $maxitems);
- $output .='<ul>';
- if ($maxitems == 0) {
- $output .= '<li>' . __("No News.","techozoic") . '</li>';
- } else {
- // Loop through each feed item and display each item as a hyperlink.
- foreach ( $rss_items as $item ) {
- $output .= "<li>
- <a href='{$item->get_permalink()}'>
- {$item->get_title()}</a>
- </li>";
- }
- $output.='</ul>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement