How to use a single image on Facebook when your website is shared

Ideally, you would want to use context specific images to be shown on Facebook whenever any page of your WordPress website is shared on Facebook, but if for some reason you want only a single image to be shown irrespective of the context, that can be configured using my plugin - Facebook Like Thumbnail though it specifies context specific images by default.

You need to install the plugin, configure the default image to be used from the settings page. And then paste the following code in your functions.php file:

This short-circuits the logic of the plugin and specifies the default image specified in settings to be used for all pages.

I see this use-case as being very limited to what everyone would want, so I don't want this to be added as another option in the plugin itself, but it can be achieved using short-circuit opportunity offered by the plugin's architecture. Even if you want to plug in custom logic to figure out the image to use, that's possible too.

Let me know if you run into any issues.

Published by

Ashfame

Developer + Entrepreneur + Open Source fanatic. Love WordPress + Startups + Adventure + Music.