Remove certain social share icons and keep others.
-
As my site is targeted towards english language readers, I don’t feel much use for the Russian social share icons like: vkontakte.ru and odnoklassniki.ru.
But I would like to keep the facebook, google+ and twitter icons.
Please help.
-
Please follow below instruction:
1. Login as admin and click on ‘Customize’.
screenshot->
2. Then go to Custom Code and put below css code into Custom CSS Box..ya-share2__list_direction_horizontal > .ya-share2__item_service_vkontakte, .ya-share2__item_service_odnoklassniki { display:none !important; }
screenshot:
screenshot:Hope it will work for you.
Hello!
If you want to keep only facebook, google + and twitter share buttons, you need to install and activate Basic child theme and add the following function to functions.php file of child theme:function basic_social_buttons( $old_soc_html ) {
$soc_html = “<div class=’social_share clearfix’>”;
$link = get_permalink();
$title = get_the_title();
$soc_html .= ‘
‘;
$soc_html .= “</div>”;
return $soc_html;
}
add_filter( ‘basic_social_share’, ‘basic_social_buttons’ );Or add this code to plugin FunctionsPHP.
Hello!
If you want to keep only facebook, google + and twitter share buttons, you need to install and activateBasic child theme and add the following function to functions.php file of child theme:
function basic_social_buttons( $old_soc_html ) {
$soc_html = “<div class=’social_share clearfix’>”;
$link = get_permalink();
$title = get_the_title();`
$soc_html .= ‘
`
‘;$soc_html .= “</div>”;`
return $soc_html;
}
add_filter( ‘basic_social_share’, ‘basic_social_buttons’ );Or add this code to plugin FunctionsPHP.
`
function basic_social_buttons( $old_soc_html ) {
$soc_html = “<div class=’social_share clearfix’>”;
$link = get_permalink();
$title = get_the_title();
$soc_html .= ‘
<a rel=”nofollow” class=”psb fb” target=”_blank” href=”https://www.facebook.com/sharer.php?u=’ . $link . ‘&t=’ . urlencode( $title ) . ‘&src=sp” title=”‘ . __( ‘Share in’, ‘basic’ ) . ‘ Facebook”></a>
<a rel=”nofollow” class=”psb gp” target=”_blank” href=”https://plus.google.com/share?url=’ . $link . ‘” title=”‘ . __( ‘Share in’, ‘basic’ ) . ‘ Google+”></a>
<a rel=”nofollow” class=”psb tw” target=”_blank” href=”https://twitter.com/share?url=’ . $link . ‘&text=’ . urlencode( $title ) . ‘” title=”‘ . __( ‘Share in’, ‘basic’ ) . ‘ Twitter”></a>
‘;$soc_html .= “</div>”;
return $soc_html;
}
add_filter( ‘basic_social_share’, ‘basic_social_buttons’ );
`
Sorry, I’m confused. The first solution did not work. I add the provided code in the custom codes settings but nothing changed.
For the second solution, I don’t know how to install and activate Basic Child theme?
Or add this code to plugin FunctionsPHP.
I can’t find this plugin.
Help.- This reply was modified 8 years ago by Deranged_Dev.
You can download Basic child theme following this link https://wp-puzzle.com/docs/basic/where-to-get-a-child-theme.html
And you can download plugin FunctionsPHP following this link https://en.wp-puzzle.com/functionsphp/Thank you for the help. I tried the method with installing FunctionsPHP plugin. And pasted the code provided by you. It gave me the following error:
Hello!
Try add this snippet to plugin FunctionsPHP:function social_buttons( $old_soc_html ) { $soc_html = "<div class='social_share clearfix'>"; $link = get_permalink(); $title = get_the_title(); $soc_html .= ' <a rel="nofollow" target="_blank" href="https://www.facebook.com/sharer.php?u=' . $link . '&t=' . urlencode( $title ) . '&src=sp" title="' . __( 'Share in', 'basic' ) . ' Facebook"></a> <a rel="nofollow" target="_blank" href="https://plus.google.com/share?url=' . $link . '" title="' . __( 'Share in', 'basic' ) . ' Google+"></a> <a rel="nofollow" target="_blank" href="https://twitter.com/share?url=' . $link . '&text=' . urlencode( $title ) . '" title="' . __( 'Share in', 'basic' ) . ' Twitter"></a> '; $soc_html .= "</div>"; return $soc_html; } add_filter( 'basic_social_share', 'social_buttons' );
Oh, sorry. It is problem with code formatting. Try copy and paste again
function social_buttons( $old_soc_html ) { $soc_html = "<div class='social_share clearfix'>"; $link = get_permalink(); $title = get_the_title(); $soc_html .= ' <a rel="nofollow" target="_blank" href="https://www.facebook.com/sharer.php?u=' . $link . '&t=' . urlencode( $title ) . '&src=sp" title="' . __( 'Share in', 'basic' ) . ' Facebook"></a> <a rel="nofollow" target="_blank" href="https://plus.google.com/share?url=' . $link . '" title="' . __( 'Share in', 'basic' ) . ' Google+"></a> <a rel="nofollow" target="_blank" href="https://twitter.com/share?url=' . $link . '&text=' . urlencode( $title ) . '" title="' . __( 'Share in', 'basic' ) . ' Twitter"></a> '; $soc_html .= "</div>"; return $soc_html; } add_filter( 'basic_social_share', 'social_buttons' );
Hi thank you again. Sorry for being such a novice about this. But I added the code and now all social share icons are gone ??
My website: https://www.securityguybob.com/
- This reply was modified 8 years ago by Deranged_Dev.
Sorry again! Code for social share icons worked out but CSS classes disappeared. Try to copy and insert function again!
function social_buttons( $old_soc_html ) { $soc_html = "<div class='social_share clearfix'>"; $link = get_permalink(); $title = get_the_title(); $soc_html .= ' <a rel="nofollow" class="psb fb" target="_blank" href="https://www.facebook.com/sharer.php?u=' . $link . '&t=' . urlencode( $title ) . '&src=sp" title="' . __( 'Share in', 'basic' ) . ' Facebook"></a> <a rel="nofollow" class="psb gp" target="_blank" href="https://plus.google.com/share?url=' . $link . '" title="' . __( 'Share in', 'basic' ) . ' Google+"></a> <a rel="nofollow" class="psb tw" target="_blank" href="https://twitter.com/share?url=' . $link . '&text=' . urlencode( $title ) . '" title="' . __( 'Share in', 'basic' ) . ' Twitter"></a> '; $soc_html .= "</div>"; return $soc_html; } add_filter( 'basic_social_share', 'social_buttons' );
wow. Thank you so much, it worked!
We were glad to help!
Such a beautiful theme and layout but the coding and to make simple edits like remove Russian social media is horrendous!
Man, why not just make it an easier way to edit social media icons and make simple edits?
Not very user friendly at all unless your a programmer.Hello!
Thanks for your suggestion, we really appreciate it!
Notification of this issue has been added to the task list of Basic theme and will be fixed in an update.
- The topic ‘Remove certain social share icons and keep others.’ is closed to new replies.