get_item_quantity WordPress 2.9 error
-
I had the following code working fine with 2.8
<ul> <?php if(function_exists('fetch_feed')){ $uri = 'https://search.twitter.com/search?q=test'; $feed = fetch_feed($uri); $maxitems = $feed->get_item_quantity(2); } ?> <?php //printf( $feed->get_title()); foreach ($feed->get_items(0, $maxitems) as $item){ $links = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'); $img = $links[1]['attribs']['']['href']; echo "<li>"; printf('<a href="%s"><img alt="%s" src="'.$img.'" /></a>',$item->get_permalink(), $item->get_title()); //printf('<h2><a href="%s">%s</a></h2>',$item->get_permalink(), $item->get_title()); echo "<p>"; printf('%s',$item->get_description()); //printf('%s',$item->get_link()); printf(' <strong>%s</strong>',$item->get_date('j F Y | g:i a')); echo "</p>"; echo "</li>\n"; } ?> </ul>
I upgraded to 2.9 and I get the following error:
Fatal error: Call to undefined method WP_Error::get_item_quantity() in domain\wp-content\themes\mytheme\footer.php on line 14
Any ideas?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘get_item_quantity WordPress 2.9 error’ is closed to new replies.