Gravatar Hovercard

Jetpack: how to avoid triggering Gravatar Hovercards

Gravatar is cool. And you know what’s cooler? Gravatar Hovercards!

Gravatar Hovercard

These are triggered as soon as you insert a Gravatar into a post, or in a comment section for example. However, there are times when you don’t want to trigger Hovercards. A good example is a site header like on my other site. I use my Gravatar as a header image, and I want my readers to be able to click this image to go back to the home page.

Luckily, you can use the .no-grav class to ask the Hovercard to ignore a specific image like so:

<img src="<?php echo pinkman_get_gravatar(); ?>" class="no-grav" width="120" height="120" />

Cinema: About Time

I love Bill Nighy, and when I saw the plotline of About Time, I knew I would like the movie:

At the age of 21, Tim discovers he can travel in time and change what happens and has happened in his own life. His decision to make his world a better place by getting a girlfriend turns out not to be as easy as you might think.

I didn’t expect the movie to be so good, though. More than just another sci-fi or romance movie, it’s a celebration of life, an invitation to live your life to the fullest, as if every day would be the last.

You should see that movie. I promise you’ll enjoy it!

Jetpack's sharing buttons

Jetpack: remove the share counts from the sharing buttons

Jetpack’s sharing buttons look good, are simple, and offer 4 different display options:

  • Icon + Text
  • Text
  • Icon
  • Official Buttons

If you choose the 2 first button types, Jetpack automatically adds sharing counts for the most popular Social Networks.

Jetpack's sharing buttons

This is great, but what if you don’t want to make extra requests to external services for each post that you publish on your site? Luckily, Jetpack allows you to remove the sharing counts with a simple filter:

add_filter( 'sharing_js', '__return_false' );

Once you add that filter to a functionality plugin or to your theme’s functions.php file, Jetpack will stop adding the Javascript library responsible for calling each Social Network to count the number of shares.
Your sharing buttons won’t include any count anymore, but you will have saved a few resources on your site!

Note: If you use the Email sharing button, this code will break it. You’ll want to enqueue the Email Javascript code back before to add the Email sharing button again.


Git: Merge vs Rebase

Until today, when working in a local clone of a GitHub fork of mine, I always used git merge upstream/master to keep my clone up to date.

However, it seems there were times I should have been using git rebase upstream/master. Git’s docs are not too helpful for me, unfortunately:

You can take the patch of the change that was introduced in C3 and reapply it on top of C4. In Git, this is called rebasing. With the rebase command, you can take all the changes that were committed on one branch and replay them on another one.


It seems I should be using merge in most cases, but use rebase when working in a branch, and wanting to apply remote changes to my branch before I merge it into master (or send a pull request). I’ll play a bit with this, and see if I understood things correctly!

And if you’re working with GitHub like me, you might enjoy this post, that will guide you through the steps to follow to rebase a branch that you used to submit a Pull Request on GitHub.

Git: checkout a remote branch

Sometimes, I push a branch from a local repository to a remote and want to checkout that branch in another location later on.

I knew how to use git fetch to fetch all branches in that remote but couldn’t find out how to checkout the branch. Turns out, it’s really easy!

git co -b branch origin/branch

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 );