Display Simplepie RSS Feed In Reverse Order
Posted at 11:45 pm on February 28th, 2010 in Tips & Tricks Hits: 1,162

Faced problem to display RSS Feed items in reverse order using the Simplepie script. The solution provided in the Simplepie documentation is disable the order of the item by date.

Solution in the documentation requires us to use the following code along with your script.

$feed->enable_order_by_date(false);

This did not seem to work for me. So the only solution i had was to use the PHP reverse function instead. So to those who wish to display your Simplepie feed in reverse order, you may use the following code where needed.

<?php foreach (array_reverse($feed->get_items()) as $item): ?>

Replace the code as needed and your feed should be in reversed order.


|

 
About Me

I'm ramesh from Perak, Malaysia. Blogging is my hobby hence this blog is my second home to share my life, interests and etc. One can always interact with me by using the mediums below.



Blog Menu

» Main Page
» Blogging ( 137 | rss )
» Info Tech ( 43 | rss )
» Mesh Views ( 3 | rss )
» My Mesh ( 17 | rss )
» My Poems ( 6 | rss )
» My Workshop ( 16 | rss )
» myIndians-World ( 45 | rss )
» Places & Events ( 62 | rss )
» Shoot Me ( 17 | rss )
» Tips & Tricks ( 21 | rss )
» Contact Me


Micro Mesh



Get Updates



 

page made and maintained by mesh