Hot answers tagged

11

Facebook now uses opengraph protocol. You can add images using : <meta property="og:image" content="http://YOUR_IMAGE_URL" /> Add this line to your page header. Alternatively you can use my plugin to do this automatically. It just does this job and no settings are needed. http://shailan.com/wordpress/plugins/facebook-meta-tags-plugin/


8

<meta property="og:image" content="http://alexchen.info/taiwantalk/wp-content/uploads/2011/03/cheating.png" /> Visit http://developers.facebook.com/docs/reference/plugins/like/ and see "Step 2 - Get Open Graph Tags" There's also a lot of WP plugins out there that can help you to generate Open Graph tags.


7

My number 1 feature would be to have the ability to use WordPress to manage a fan page. It would have to have the ability to use a WordPress page to create a Facebook page application tab. Published posts would auto publish to the Facebook wall and comments would sync between WordPress and Facebook.


7

The image that is used for sharing is taken from a chunk of code in the header of your site that will look something like this: <link rel="image_src" href="path/to/theme/screenshot.png" /> Typically it links to the screenshot of your site in the theme. If you removed the code from the header of the file and on single.php put it inside the loop and ...


6

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 video player, ...


6

Fast 'n' Hacky The problem can be solved by changing line 319 in facebook.php to the following: if (is_home()) { This way, the front page is not treated as a home page but as a regular page, for which the facebook feature settings can be applied (and will be handled correctly). More Elegant/Complex Here is a non-hackish version. Put the following in ...


5

To get your friends as a JSON object from Facebook, you can use their Graph API. Easiest way is to visit this page: http://developers.facebook.com/docs/reference/api/user/ Scroll down until you find the Friends link in the "Connections" table. That link will give you a JSON object containing all your friends. Note that the URL on that page is unique to you ...


5

You need to use the Facebook Open Graph Protocol. I'm not sure why the Accepted answer isn't one of the many OG: related answers (which I've voted up) but it is wrong. http://developers.facebook.com/docs/opengraph/ You can customize many things including title, image, description, category, last update etc... if you use Open Graph. If you use these other ...


4

Put this in your head <?php $fb_image = wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID() ), 'thumnail'); ?> <?php if ($fb_image) : ?> <meta property="og:image" content="<?php echo $fb_image[0]; ?>" /> <?php endif; ?> To test it out, you don't have to create a new post, just paste your URL in here: ...


4

In the source code I see two og:description meta tags. The first and correct one seems to be coming from your Yoast WordPress SEO Plugin. The other one is outside the plugin's block, so I guess it's defined elsewhere. Check your theme if it includes that meta tag. If not, check your other plugins. Disable them one by one to find the culprit.


4

I've managed to find a solution to my problem. I solved it with three plugins Members User Role Editor Social Login The combination of these plugins allows you to who can log in, without telling them how to log in. More specifically, anyone will be able to log in with a social network, but they won't be able to see everything. With User Role Editor, you ...


4

To answer my own question, when you use WP_Http, the transport used is selected, in this order, from this array: $request_order = array( 'curl', 'streams', 'fsockopen' ); If your PHP supports curl, WP_Http_Curl is used. Curl doesn't support adding the body array parameters when the method is GET WP_Http_Streams and WP_Http_Fsockopen on the other hand, add ...


4

I use disqus on my site and it works quite well.


4

This is a bit of a multi-part question, so you're getting a multi-part answer. Getting the Facebook count can be done by making a request to https://graph.facebook.com/URL. This will return a json object which contains, among other things, the number of "shares". Working example which has 4 shares as of this writing: ...


4

Final version of code used: function fb_comment_count($link = 'link') { global $post; $url = 'https://graph.facebook.com/'; $posturl = get_permalink($post->ID); $url .= $posturl; $filecontent = wp_remote_retrieve_body(wp_remote_get($url, array('sslverify'=>false))); $json = json_decode($filecontent); $count = $json->comments; if ($count == 0 ...


4

To answer this one and point to the real problem: As the <head> HTML tag comes far before the actual loop, you'll need something else than the global $post. get_queried_object(); get_queried_object_id(); The plugin The code is tested and works. As you might want to keep this functionality when switching themes, I'd suggest wrapping it up in a ...


4

Facebook caches the meta values for performance. So it is currently hosting an old version of the shared URL. You need to use the Facebook debugger, and Fetch new scrap info. This will update the stored meta values of the post. To confirm that it works, I have already fetched new data for the respective URL and this is how it looks when I share it on FB: ...


3

Go to Settings > Sharing in your dashboard Sroll down until the "Button Style" option. Choose "Official Buttons". The Facebook Share button has now changed into a Facebook Like Button. Save your changes, and you'll be good to go! If you want to add a Facebook Share button next to the Like button, you can use the "Add a new service" option: In "Service ...


3

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 use the javascript ...


3

I just added this feature to the beta branch of Simple Facebook Connect. It pulls comments back from auto-published stories and integrates them into the normal comments stream. Features: Integrated with Auto-Publish. When you post, and it's auto-published to your Page or Profile, SFC notices and saves the resulting story IDs for later polling. Fast. Every ...


3

Facebook caches information about a page when share it. You can use the URL Linter to refresh the cache and see exactly what info FB has on your page. The linter has helped me quite a bit with these issues.


3

The easy way to automate the publishing of your WordPress posts to your Facebook fan page is to use Facebook's built in Notes application. You will need your sites feed link which is usually http://example.com/feed. Go to your fan page and click the edit page link then go to applications and under "Notes" click "go to app" at the bottom left hand side of ...


3

You can accomplish that with: a regular instal of WordPress but with a lot of work and hacking around to get it where you want. a multisite install of WordPress that would make it a bit easier but still a lot of work and customization. a fairly easy case with BuddyPress. Basically it just installing BuddyPress ,some plugins and configuring it a bit not ...


3

Yes, try BuddyPress. BuddyPress allows extended profiles, plus your members can write their own blogs.


3

I don't have the plugin to test this, but looking at the lines to hack, as pointed by @tf: if ( is_home() || is_front_page() ) { $enabled_features = get_option( sprintf( $option_name, 'home' ) ); } else if ( is_archive() ) { // all archives wrapped in one option // is_post_type_archive || is_date || is_author || is_category || is_tag || is_tax ...


3

First, this isn't a WordPress specific question, it's a Facebook question. Secondly, Facebook caches pages, they don't crawl them on every submission. If you have a URL that has already been submitted to Facebook before, then they will have already crawled it for the OG data once before, and saved it to their cache. If you later change the OG data, they ...


3

Hi @Rikard: @user653 is correct, you can't do it in a text widget with PHP but you can do it in a text widget using JQuery/Javascript. Here's how. Starting with the Facebook Share Button HTML I assume you plan to use use the Facebook Share Button and thus will have HTML code in your widget that will look like this? <a name="fb_share"></a> ...


3

I haven't used Socialite before today, so I did a quick install to see if I could reproduce the problem and ... wow ... The system is definitely broken. Facebook requires you to partially host your application on your own server. You set up some integration so you can use its API, but most of the work actually happens off-site. With other ...


3

You should add the list of comments within the comments.php file the following code: <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(post_permalink() . '#comment-' . comment_ID()); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" ...


3

I've come across this same problem before... a few things you can do. In your website, make sure you have..... An appropriate image close to the top of the page, title and alt tag are relevant A "description" META tag this is a tag that occurs in the <head></head> of the page example: <meta name="description" content="enter your description ...



Only top voted, non community-wiki answers of a minimum length are eligible