Should I store my Facebook access tokens?

There are a number of explanations here: https://developers.facebook.com/docs/facebook-login/access-tokens The time it takes for your server to talk with facebook does contribute to a good amount of slowdown. So it depends on how intensely you plan to use the api. In that case, storing the key and other fb related user data can cut that cross-talk … Read more

Adding a “most liked post” box, based on facebook ranking?

A quick google brought up these, which led me to this post. You can access the site’s object in the Graph and get the current “Fan count”. i.e. http://graph.facebook.com/http://google.com. Note that you will need an oauth token to do this. This is definitely the most accurate way of getting a page’s Likes. You can also … Read more

sharing video on facebook from wordpress

That really depends on how the video is embedded into the page. Facebook can only handle specific formats and if it sees something it doesn’t expect, it defaults to a failsafe “show nothing” standard. If the embedded video is well-recognized standard (i.e. YouTube’s default player) it should work just fine. If it’s your own self-hosted … Read more

Facebook sharer and parameters in URL

I can see that you are rewritting to a specific page and I think that your problem is that WordPress inserts the canonial meta tag in the <head> of the HTML automatically for all core post types (post, pages, …). This meta tag will be pointing to the original page, because you are really in … Read more

Generating the ogp tags in theme

If it is a page the global post object is already set when wp_head fires. But you have to get the data for this page with custom code. Pseudo code: add_action ( ‘wp_head’, ‘wpse_58539_get_ogp’ ); function wpse_58539_get_ogp() { if ( ! is_page_template( ‘your-template-name’ ) ) { return; } $page = get_post( $GLOBALS[‘post’] ); // Inspect … Read more

custom field with total count of Facebook likes, comments and shares

I’ve done it, here is the complete code: function insert_facebook_likes_custom_field($post_ID) { global $wpdb; if (!wp_is_post_revision($post_ID)) { add_post_meta($post_ID, ‘likes_count’, ‘0’, true); } } add_action(‘publish_page’, ‘insert_facebook_likes_custom_field’); add_action(‘publish_post’, ‘insert_facebook_likes_custom_field’); function update_facebook_likes($content=””) { global $wp_query; $permalink = get_permalink(); $idpost = $wp_query->post->ID; $data = file_get_contents(‘http://graph.facebook.com/?id=’.$permalink); $json = $data; $obj = json_decode($json); $like_no = $obj->{‘shares’}; $meta_values = get_post_meta($idpost, ‘likes_count’, true); if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)