Sort Blog posts and comments by "likes"

Hi, I'm trying to display the most "liked" blog posts and the most (globally) "liked" comments, sorted by the number of likes for each one. I'm kind of stuck. Any hints, please?

(V 1.8)

Thanks!