This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get fb likes from fb graph api | |
// put this block in single.php, or somewhere you have $post and have setup postdata [inside a Loop] | |
$obj = json_decode( file_get_contents( 'http://graph.facebook.com/?id='.get_permalink() ) ); | |
$likes = $obj->shares; | |
update_post_meta($post->ID, '_fb_likes', $likes, false); | |
// make a Loop [in a template page or whatever] to query and display posts ordered by fb like popularity | |
$args = array( |