darkleviathan
@darkleviathan

Какой плагин без заморочек на Wordpress для возможности делиться записями в соц. сетях?

Порекомендуйте простой плагин с помощью которого можно делиться новостями в базовых соц. сетях (facebook, twitter, odnoklasniki, vk)
  • Вопрос задан
  • 117 просмотров
Решения вопроса 1
azerphoenix
@azerphoenix
Java Software Engineer
Если действительно без заморочек, то https://tech.yandex.ru/share/
А если нужен плагин, то вот: https://codecanyon.net/item/social-share-locker-pr...
А если без плагина и без js вообще, то использую следующий код:
// social share buttons
function phoenix_social_sharing_buttons($content) {

	global $post;
	if(is_single() || is_home() ){
	
		// Get current page URL 
		$phoenixURL = urlencode(get_permalink());
 
		// Get current page title
		$phoenixTitle = str_replace( ' ', '%20', get_the_title());
		
		// Get Post Thumbnail for pinterest
		$phoenixThumbnail = 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='.$phoenixTitle.'&url='.$phoenixURL.'&via=md7_info';
		$facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$phoenixURL;
		$googleURL = 'https://plus.google.com/share?url='.$phoenixURL;
		$linkedInURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$phoenixURL.'&title='.$phoenixTitle;
 
		// Add sharing button at the end of page/page content
		$content .= '<div class="phoenix-social">';
		$content .= '<a class="phoenix-link phoenix-twitter" rel="nofollow noopener noreferrer" href="'. $twitterURL .'" target="_blank">Twitter</a>';
		$content .= '<a class="phoenix-link phoenix-facebook" rel="nofollow noopener noreferrer" href="'.$facebookURL.'" target="_blank">Facebook</a>';
		$content .= '<a class="phoenix-link phoenix-googleplus" rel="nofollow noopener noreferrer" href="'.$googleURL.'" target="_blank">Google+</a>';
		$content .= '<a class="phoenix-link phoenix-linkedin" rel="nofollow noopener noreferrer" href="'.$linkedInURL.'" target="_blank">LinkedIn</a>';
		$content .= '</div>';
		
		return $content;
	} else {
		return $content;
	}
};
add_filter( 'the_content', 'phoenix_social_sharing_buttons');

сами дополните код по нужде...
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
@vardoLP
Ват ю сэй эбаут май мама?!
я всегда яшку использую и никаких плагинов не надо. Вполне себе нормальный
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы