Hook of the Month: Customizing Sharing Buttons

Jetpack for WordPress

Jetpack’s sharing buttons look good, are simple to use, and include several hooks allowing you to customize every single aspect of the module. Let’s learn to use some of these hooks together!

Remove Sharing buttons on Mobile

Whether your site uses Jetpack’s Mobile Theme or a responsive theme, it’s sometimes useful to remove sharing buttons on mobile devices. Since most mobile phones include built-in options to share a link on popular social networks, removing those buttons from your site can be a real performance gain on mobile.

To completely remove the buttons, we’ll use two Jetpack features: the sharing_show filter, and a function named jetpack_is_mobile(). This function allows you to detect if your reader is browsing your site using a mobile device (with a Mobile User Agent).

Hide buttons in the Sharing Settings interface

You can use the sharing_services filter to hide some buttons from the Sharing Settings interface…

View original post 265 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s