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:
 * Description: Removes Jetpack's default og:title tag, and replaces it with an uppercase og:title 
 * Author: Jeremy Herve
 * Version: 1.0
 * Author URI:
 * 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 );

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.

Continue reading Google Social Analytics : Analyser les actions sociales 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.

Continue reading How to: create a Facebook iFrame application thanks to WordPress