Trying to parse rss feed with items that have multiple categories per item. The original file is an atom structured feed which I have parsed using simplexml and outputed certain elements as an rss feed. The multiple categories in the original atom file are stated as attributes to the category element. I'm trying to display items based on any category defined. As it is now simplepie only recognizes the first category. The simplified code is as follows:
<item>
<title>Banana</title>
<category>Fruit</category>
<category>Yellow</category>
</item>
<item>
<title>Apple</title>
<category>Round</category>
<category>Fruit</category>
</item>
// display all titles from items with category 'Fruit'
<?php
foreach ($feed->get_items() as $item):
if(
$item->get_category()->get_label() == 'Fruit'
):
echo $item->get_title();
endforeach;
// result - displays only Banana but not Apple