fix: suppression partage RS

This commit is contained in:
Kazhnuz 2022-11-23 21:33:28 +01:00
parent dce339c0a0
commit 0562f3f63e

View file

@ -142,57 +142,6 @@ function kspace_cat_breadcrumb_with_rss($categoryName, $icon, $categoryType, $rs
<?php <?php
} }
/* 2. Réseaux sociaux
*
* Permet d'afficher les réseaux sociaux en bas du post.
*
*/
function mypost_social_sharing_buttons($content) {
// Fork of mypost_social_sharing_buttons
// You can find the original at the following url:
// https://mypost_.com/how-to-create-social-sharing-button-without-any-plugin-and-script-loading-wordpress-speed-optimization-goal/
global $post;
if(is_singular() && !is_page()){
// Get current page URL
$mypost_URL = urlencode(get_permalink());
// Get current page title
$mypost_Title = htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8');
// $mypost_Title = str_replace( ' ', '%20', get_the_title());
// Get Post Thumbnail for pinterest
$mypost_Thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
// Construct sharing URL without using any script
$twitterURL = 'https://twitter.com/intent/tweet?text='.$mypost_Title.'&amp;url='.$mypost_URL.'&amp;via=mypost_';
$facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$mypost_URL;
$bufferURL = 'https://bufferapp.com/add?url='.$mypost_URL.'&amp;text='.$mypost_Title;
$whatsappURL = 'whatsapp://send?text='.$mypost_Title . ' ' . $mypost_URL;
$linkedInURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$mypost_URL.'&amp;title='.$mypost_Title;
$diasporaURL = 'http://sharetodiaspora.github.io/?title=' . $mypost_Title . '&url=' . $mypost_URL;
// Based on popular demand added Pinterest too
$pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$mypost_URL.'&amp;media='.$mypost_Thumbnail[0].'&amp;description='.$mypost_Title;
// Add sharing button at the end of page/page content
$content .= '<!-- based on crunchify social sharing. Get your copy here: http://crunchify.me/1VIxAsz -->';
$content .= '<div class="reagir share-buttons">';
$content .= '<a class="btn-small btn-twitter" href="'. $twitterURL .'" target="_blank"><i aria-label="twitter" class="fa fa-fw fa-twitter"></i></a> ';
$content .= '<a class="btn-small btn-facebook" href="'.$facebookURL.'" target="_blank"><i aria-label="facebook" class="fa fa-fw fa-facebook"></i></a> ';
$content .= '<a title="Share to Diaspora*" class="btn-small btn-diaspora" href="'.$diasporaURL.'" target="_blank"><i class="fa fa-fw fa-diaspora"></i></a>';
$content .= '</div>';
return $content;
}else{
// if not a post/page then don't include sharing button
return $content;
}
};
add_filter( 'the_content', 'mypost_social_sharing_buttons');
/* 3. Plus d'info sur les tags /* 3. Plus d'info sur les tags
* *
* Permet d'afficher un lien vers plus d'informations. * Permet d'afficher un lien vers plus d'informations.