Advertisement
Guest User

Untitled

a guest
Jan 26th, 2011
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. if (!is_wp_error( $rss ) ) {
  2. // Checks that the object is created correctly
  3. // Figure out how many total items there are, but limit it to $feed_items.
  4. $maxitems = $rss->get_item_quantity($feed_items);
  5.  
  6. // Build an array of all the items, starting with element 0 (first element).
  7. $rss_items = $rss->get_items(0, $maxitems);
  8. }
  9.  
  10.  
  11. $output .='<ul>';
  12. if ($maxitems == 0) {
  13. $output .= '<li>' . __("No News.","techozoic") . '</li>';
  14. } else {
  15. // Loop through each feed item and display each item as a hyperlink.
  16. foreach ( $rss_items as $item ) {
  17. $output .= "<li>
  18. <a href='{$item->get_permalink()}'>
  19. {$item->get_title()}</a>
  20. </li>";
  21. }
  22. $output.='</ul>';
  23. }
  24.  
  25. // Change above code to this code.
  26.  
  27. if (!is_wp_error( $rss ) ) {
  28. // Checks that the object is created correctly
  29. // Figure out how many total items there are, but limit it to $feed_items.
  30. $maxitems = $rss->get_item_quantity($feed_items);
  31.  
  32. // Build an array of all the items, starting with element 0 (first element).
  33. $rss_items = $rss->get_items(0, $maxitems);
  34.  
  35.  
  36. $output .='<ul>';
  37. if ($maxitems == 0) {
  38. $output .= '<li>' . __("No News.","techozoic") . '</li>';
  39. } else {
  40. // Loop through each feed item and display each item as a hyperlink.
  41. foreach ( $rss_items as $item ) {
  42. $output .= "<li>
  43. <a href='{$item->get_permalink()}'>
  44. {$item->get_title()}</a>
  45. </li>";
  46. }
  47. $output.='</ul>';
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement