I had the same problem.
FYI, I figured out what is going on here, the plugin is using the feed functions of wordpress, and apparently the sort by date is default behavior, even if not specified.
if ( !is_wp_error( $rss ) ) {
if ($orderby == 'date' || $orderby == 'date_reverse') {
$rss->enable_order_by_date(false);
}
This is a hack, but it works. Line 61, $rss->enable_order_by_date(false), instead of true. The next update for the plugin should specify:
$rss->enable_order_by_date(false)
before it gets into the logic of setting it to true. This way, the output matches the rss.xml feed as displayed, instead of using the original post date.
Where I specifically had a problem was where a feed item was originally dated in March, but updated last month with new info and was now at the top of the rss feed (the publish date remained as March).
Once I changed the true to false, my local feed matched the remote feed perfectly.
Recommended future plugin code change:
$rss = fetch_feed( $urls );
$rss->enable_order_by_date(false); #<--set default behavior.
remove_filter( 'wp_feed_cache_transient_lifetime', 'wp_rss_retriever_cache' );
if ( !is_wp_error( $rss ) ) {
if ($orderby == 'date' || $orderby == 'date_reverse') {
$rss->enable_order_by_date(true);
}
Great plugin, five stars!!!
-
This reply was modified 6 years, 10 months ago by
perltechs.
-
This reply was modified 6 years, 10 months ago by
perltechs.
-
This reply was modified 6 years, 10 months ago by
perltechs.
Thread Starter
swcomm
(@swcomm)
Hi – that’s funny, I did kind of the same thing. Hacked enable_order_by_date to false in the plugin. Works beautifully. Yes, I agree, it’s a great plugin but needs this one small modification to enable alternate date sorting method.
Plugin Author
Travis
(@tjtaylor)
Thanks for your feedback! I’ll be shipping this change with the next version.
Hi Travis, this is exactly my problem. I’m using an RSS feed for which I need the posts to be in the original order. But when I use your plugin it sorts them. Can you please update the plugin so it’s possible to leave the feed in the original order? Thanks
@perltechs , I changed line 61 in the plugin editor to $rss->enable_order_by_date(false) and clicked “Update file” but the order of the posts is still sorted. Is there something else that I need to do?