Last active
December 27, 2015 10:59
-
-
Save Dimasmagadan/7315703 to your computer and use it in GitHub Desktop.
Yandex social share
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// добавить этот код в functions.php | |
function os_styles_and_scripts() { | |
if(!is_admin()){ | |
wp_enqueue_script( 'yashare', '//yandex.st/share/share.js', null, '1', true ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'os_styles_and_scripts' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- этот код вставить там, где нужно вывести лайки --> | |
<div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="small" | |
data-yashareQuickServices="vkontakte,facebook,twitter,odnoklassniki,moimir,gplus" | |
data-yashareTheme="counter" | |
data-yashareLink="<?php the_permalink(); ?>" | |
data-yashareTitle="<?php the_title(); ?>" | |
data-yashareDescription="<?php the_excerpt(); ?>" | |
<?php if(has_post_thumbnail( )){ | |
$thumb=wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium'); | |
?> data-yashareImage="<?php echo $thumb[0]; ?>"<?php | |
} ?> | |
></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment