No Facebook in April

In March, I set out to move a bit more by exercising a bit every day. In April, I’ll be taking on another challenge: I won’t use Facebook at all.

Jetpack and Open Graph Meta Tags: change a post’s Media Type to Video

When sharing posts on Facebook, you may have realized that sometimes you can play a video right on Facebook, without having to click and go to another site.

Videos on Face

This is possible thanks to Open Graph Meta Tags. When you share a post on Facebook, or when Jetpack Publicize publishes a post to your Facebook page, Facebook crawls the page and looks for Open Graph meta tags in the head to build a complete post preview. That post preview will often include an image, a title, a description, and sometimes a video like on the screenshot above.

Jetpack automatically creates these Open Graph Meta tags for you unless you already use another Open Graph plugin, in which case we let the other plugin handle things.

What are you telling me, Facebook?

timeline

Jetpack: change og:title value to be all uppercase

Caps Lock

Some blog owners would like their post titles to be displayed in all caps, to attract more clicks on Facebook. Here is how to change Jetpack’s Open Graph meta tags to use an uppercase og:title tag:

/*
 * Plugin Name: Uppercase og:title for Jetpack 
 * Plugin URI: http://wordpress.org/extend/plugins/jetpack/
 * Description: Removes Jetpack's default og:title tag, and replaces it with an uppercase og:title 
 * Author: Jeremy Herve
 * Version: 1.0
 * Author URI: http://jeremy.hu
 * License: GPL2+
 */
function jeherve_capital_title_og( $tags ) {
        global $post;
 
        if ( is_singular() && $post ) {
                unset( $tags['og:title'] );
 
                $tags['og:title'] = strtoupper( get_the_title( $post->ID ) );
        }
        return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'jeherve_capital_title_og' );

To be pasted in your theme’s functions.php file, or in a functionality plugin.

Jetpack: how to define a custom fallback image

Jetpack handles Open Graph Meta Tags for you, and automatically creates a fallback Image meta tag if you haven’t inserted any image into your post.

If you’d like to define your own custom fallback image, you can use the jetpack_open_graph_image_default filter, like so:

function jeherve_default_image() {
	$fallback_img = 'http://YOUR_IMG_URL';
	return esc_url( $fallback_img );
}
add_filter( 'jetpack_open_graph_image_default', 'jeherve_default_image' );

Note that the filter is new, and will only be added to the next Jetpack release, 3.0.

Force the display of Jetpack’s OG tags

Jetpack Open Graph Meta tags are automatically disabled if you already use another plugin that supports Open Graph tags. The full list of these plugins is available here.

However, in some cases you might prefer to use Jetpack’s Open Graph tags, even if your other plugin offers such functionality. To do so, you’ll have to reactivate Jetpack’s tags by adding the following code to your theme’s functions.php file, or to a functionality plugin:

add_filter( 'jetpack_enable_open_graph', '__return_true', 100 );

Facebook Open Graph, le retour – Premières impressions

Suite à l’annonce de Facebook de la semaine dernière à la conférence f8, j’aimerais revenir sur les éléments qui m’ont marqué avec ces nouveaux services et produits.

Google Social Analytics : Analyser les actions sociales sur votre site WordPress

Avec le lancement de son bouton +1, Google s’est intéressé de plus près au tracking des différentes actions “sociales” dans Google Analytics. Le premier bénéficiaire des améliorations sociales ajoutées dans la dernière version de Google Analytics a bien sûr été le bouton +1, mais vous pouvez désormais suivre correctement le nombre de tweets, de Facebook Like et unlike sur votre site. Voici comment tracker ces actions sur votre site WordPress.

How to: create a Facebook iFrame application thanks to WordPress

If you are working with Facebook, you must have been slightly worried when they announced the end of the FBML for page tabs. Within a few weeks, some alternatives have been created, and you could switch from the old FBML to some new system. But to me none of these solutions seem satisfying. And let’s face it, I am too much of a WordPress fan not to imagine merging the two systems. So I took the opportunity to start working on a WordPress plugin that would make creating Facebook iFrame applications dead simple for people administrating a WordPress site.

Créez une application iFrame grâce au plugin WordPress Facebook applications

Si comme moi vous devez travailler avec Facebook régulièrement, vous avez du vous poser beaucoup de questions lors de l’annonce de l’arrêt du support de FBML. Après quelques semaines, de nouvelles possibilités ont vu le jour, mais aucune ne semblait être aussi simple à utiliser que l’application FBML for pages qui avait autant de succès jusqu’en Mars dernier. C’était donc l’occasion pour moi de travailler sur une extension WordPress pour rendre la création de tabs la plus simple possible pour ceux qui ont déjà un blog WordPress.