I'm trying to fetch some feeds using fetch_feed, however, into the for foreach, as the documentation says, I can access to values with common titles like title, permalink, etc using the get-> method, how can I access to those which looks like this:


Where those : generates error on my code. Any ideas?, the feed looks like this:


I need to access those with the SO: into a foreach which using the get->SOMETHING method.


This is my function:

 function get_external_feed($url, $number = 16) {
$rss = fetch_feed( $url );
if ( ! is_wp_error( $rss ) ) :
    $maxitems = $rss->get_item_quantity( number ); 
    $rss_items = $rss->get_items( 0, $maxitems );
    return $rss_items;


and my foreach looks like this:

 <?php if (count($feeds) == 0 ) : ?>
 <h3>No upcomming dates so far, come back later for more!</h3>
 <?php else : ?>
 <?php foreach ( $feeds as $item ) : ?>
       <?php $item->get->title(); ?>
 <?php endforeach; ?>
 <?php endif; ?>
  • 1
    Post your code please. It will make this easier to test. – s_ha_dum May 11 '14 at 19:28
  • Did you had a look at fetch_feed – Pieter Goosen May 11 '14 at 19:38
  • What is the "SO" namespace? Does it have a proper namespace definition at the beginning of the feed? – Otto May 11 '14 at 20:03
  • mmm it says somthing like this <rss xmlns:SO="systemonesoftware.com/rss" version="2.0"> does it make sense??? – andresmijares May 11 '14 at 20:10
  • xmlns: is "XML Namespace". – kaiser May 11 '14 at 20:12

What is the "SO" namespace? Does it have a proper namespace definition at the beginning of the feed?

If it does, then you can use the get_item_tags function, most likely.

The fetch_feed() function returns a SimplePie object. See the documentation for SimplePie here:


Now, your $item in the code is a SimplePie_Item object:


Which has the get_item_tags function:


So, basically, the code would look like this:

$item->get_item_tags('http://example.com/namespace', 'AppId');

To get the SO:AppId. But in order for that to work, the "SO" namespace, which is not standard, has to be defined in the document somewhere, and the URI that it is defined as would be the URI you use in that function call.

The return from that call will be an array consisting of the attributes, data, and child elements. So you'll need to look through it to find the specific data you require.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.