Home Doc Developers Managing Social Networks on Specific Positions
You can use these simple filters to hide and show specific social networks on specific positions. We have developed filters for all positions such as InLine, Sidebar, On Media, Fly-In, and Popup.
For the positioning of buttons at certain location/s, we have several filters to be used to change the order of buttons and show specific buttons and perform several other tasks.
Here is a piece of code to help you with your problem of showing just Pinterest share on specific attachments with the help of IDs.
add_filter( 'ssb_media_social_networks', 'ssb_attachment_buttons', 10 );
/**
* To display specific social networks on media.
*
* @return array|mixed array of social networks or boolean.
*/
function ssb_attachment_buttons() {
// Define The post id/s to display simple social buttons on. ( It can also contain the attachment IDs ).
$post_ids = array( '31', '53' );
// match current post ID from the defined array of Post IDs, else return and don't show the button on attachments.
if ( in_array( get_the_ID(), $post_ids ) ) {
return array(
// "fbshare" => 2,
// "twitter" => 3,
// "linkedin" => 4,
// "fblike" => 5,
"pinterest" => 1,
);
} else {
return false;
}
}
You have to copy and paste these two pieces of code in the functions.php file of your child theme.
Here is a list of filters that can be used to control social networks for various locations.
ssb_sidebar_social_networks ssb_inline_social_networks ssb_media_social_networks ssb_popup_social_networks ssb_flyin_social_networks
See these filters in action here