Php shortcode?
-
Hi,
Could you provide a php shortcode? I’d like to put it in “Home” that’s why i ask.
Thank you in advance
The page I need help with: [log in to see the link]
-
just use code:
<div class="ya-share2" data-services="facebook,twitter,pocket,viber,whatsapp,telegram" data-counter=""></div>Hi @flector first of all thank you for the speedy reply i’ve thought it might take much longer for a reply.
The DIV you’ve provided shares just the site as a whole, i’ve meant i have posts in “Home” too, just like a “latest posts feed” so i need a shortcode to have the regular yandex share output code for each post.
My custom theme isn’t based on a standard theme so i need to add it manually.
Thank you in advance
php shortcode or wordpress shortcode?
php:
<div class="ya-share2" data-services="facebook,twitter,pocket,viber,whatsapp,telegram" data-counter="" <?php echo 'data-url="'. esc_url( get_permalink( get_the_ID() ) ) .'" '; ?> <?php echo 'data-title="'. get_the_title( get_the_ID() ) .'" '; ?> ></div>documentation (in russian) – https://tech.yandex.ru/share/doc/dg/add-docpage/
Hey @flector that code worked, any idea how to have just a menu “…” button and then a inline popup with all the networks there instead of many share buttons? That would be awesome.
Other than that ya ne govorju parusski, porusski? π
π
<div class="ya-share2" data-services="facebook,twitter,pocket,viber,whatsapp,telegram" data-counter="" <?php echo 'data-url="'. esc_url( get_permalink( get_the_ID() ) ) .'" '; ?> <?php echo 'data-title="'. get_the_title( get_the_ID() ) .'" '; ?> data-limit="3"></div>Spaciba, spacibo? @flector π
The “copy link” is in Cyrillian any chance to have that in english and is it also possible to have the data services only in the popup and just a menu “…” button without other share links outside of it? That would be fantastika!
<div class="ya-share2" data-services="facebook,twitter,pocket,viber,whatsapp,telegram" data-counter="" <?php echo 'data-url="'. esc_url( get_permalink( get_the_ID() ) ) .'" '; ?> <?php echo 'data-title="'. get_the_title( get_the_ID() ) .'" '; ?> data-limit="3" data-lang="en"></div>and is it also possible to have the data services only in the popup and just a menu ββ¦β button
<div class="ya-share2" data-services="facebook,twitter,pocket,viber,whatsapp,telegram" data-counter="" <?php echo 'data-url="'. esc_url( get_permalink( get_the_ID() ) ) .'" '; ?> <?php echo 'data-title="'. get_the_title( get_the_ID() ) .'" '; ?> data-limit="0" data-lang="en"></div>ty samy luchshiy (or something like that) !
Thank’s a ton π
ty samy luchshiy
thanks π
The topic ‘Php shortcode?’ is closed to new replies.