add files
This commit is contained in:
68
template-parts/share-buttons.php
Normal file
68
template-parts/share-buttons.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
$post_url = esc_url( get_permalink() );
|
||||
$post_title = esc_html( get_the_title() );
|
||||
?>
|
||||
|
||||
<div class="share-panel">
|
||||
<div class="share-panel-title">
|
||||
Поделитесь с друг<span class="share-panel-inoi">ими</span>
|
||||
</div>
|
||||
|
||||
<div class="share-panel-buttons">
|
||||
<!-- VK -->
|
||||
<div class="share-panel-element">
|
||||
<a href="http://vk.com/share.php?url=<?= $post_url ?>&title=<?= $post_title ?>"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="Поделиться в ВКонтакте">
|
||||
<i class="social-icon social-icon-vk" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Telegram -->
|
||||
<div class="share-panel-element">
|
||||
<a href="https://t.me/share/url?url=<?= $post_url ?>&text=<?= $post_title ?>"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="Поделиться в Telegram">
|
||||
<i class="social-icon social-icon-tg" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Одноклассники -->
|
||||
<div class="share-panel-element">
|
||||
<a href="https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=<?= $post_url ?>"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="Поделиться в Одноклассниках">
|
||||
<i class="social-icon social-icon-ok" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$subject = get_the_title().' - Спортпресса';
|
||||
$body = "Читайте на сайте Спортпресса:\n" . get_permalink();
|
||||
|
||||
$mailto = 'mailto:?subject=' . rawurlencode($subject) . '&body=' . rawurlencode($body);
|
||||
?>
|
||||
|
||||
|
||||
<div class="share-panel-element">
|
||||
<a href="<?php echo esc_attr($mailto); ?>"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="Отправить на email">
|
||||
<i class="social-icon social-icon-email" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="share-panel-element">
|
||||
<a class="js-copy-link" href="<?php echo esc_attr($mailto); ?>"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
data-copy="<?php echo esc_url( get_permalink() ); ?>"
|
||||
aria-label="Отправить ссылку">
|
||||
<i class="social-icon social-icon-link" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user