Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 512573

Fatal error when attempting to sort by…

$
0
0

Replies: 0

The page sort using Feedzy widget and shortcode is not correct. Some items at the top are older and it is just very mixed.

I really just want to understand how this worked in order to implement a better sort function, so I attempted to place the following in my theme’s function file:

function feedzy_alphabetical_sort( $a, $b ){
    return strcmp( $a->get_title(), $b->get_title() );
}

function feedzy_items_title_sort( $items, $feedURL ){
    return usort( $items, 'feedzy_alphabetical_sort' );
}
add_filter( 'feedzy_feed_items', 'feedzy_items_title_sort', 9, 2 );

…which seems to always to lead the following error on any page with the shortcode or widget:
Fatal error: Call to a member function get_permalink() on a non-object in /home/content/43/10470443/html/blog/wp-content/plugins/feedzy-rss-feeds/includes/abstract/feedzy-rss-feeds-admin-abstract.php on line 495.

Note, I did not touch any file but the function file. When I remove the code, the website returns to normal functionality.

My server is running PHP version 5.3.24 and MySQL version 5.5.43.


Viewing all articles
Browse latest Browse all 512573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>