Answer the question
In order to leave comments, you need to log in
How to add sharing buttons to Contact and Odnoklassniki in a specific template?
Good evening everyone.
I am not a programmer, I make a personal blog on WordPress and on a ready-made template. Actually, everything triples in the template, only the little things have to be finalized with a file.
And so the question arose: how can I add sharing buttons for VKontakte and Odnoklassniki the same as in the template?
I use this template: zatolab.com/airashi/how-to-setup-cozy-workspace - round buttons at the end of each article. Icons from FontAwesome use.
I found the code in the files for them like this:
<!-- SOCIAL SHARE - data-via="subrotoazhari" -->
<div class="links">
<a href="#" data-type="twitter" data-url="<?php the_permalink(); ?>" data-description="<?php echo substr(get_the_title(), 0,140); ?>" class="prettySocial fa fa-twitter"></a>
<a href="#" data-type="facebook" data-url="<?php the_permalink(); ?>" data-title="<?php the_permalink(); ?>" data-description="<?php echo get_the_excerpt(); ?>" data-media="<?php echo esc_attr($img_url); ?>" class="prettySocial fa fa-facebook"></a>
<a href="#" data-type="googleplus" data-url="<?php the_permalink(); ?>" data-description="<?php echo get_the_excerpt(); ?>" class="prettySocial fa fa-google-plus"></a>
<a href="#" data-type="pinterest" data-url="<?php the_permalink(); ?>" data-description="<?php echo get_the_excerpt(); ?>" data-media="<?php echo esc_attr($img_url); ?>" class="prettySocial fa fa-pinterest"></a>
<a href="#" data-type="linkedin" data-url="<?php the_permalink(); ?>" data-title="<?php the_permalink(); ?>" data-description="<?php echo get_the_excerpt(); ?>" data-media="<?php echo esc_attr($img_url); ?>" class="prettySocial fa fa-linkedin"></a>
</div>
<a href="https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=<?php the_permalink(); ?>" target="_blank" class="prettySocial fa fa-odnoklassniki" title="Опубликовать ссылку в Одноклассники" onclick="window.open(this.href, 'Опубликовать ссылку в Одноклассники', 'width=800,height=300'); return false"></a>
<a href="https://vk.com/share.php?url=<?php the_permalink(); ?>" class="prettySocial fa fa-vk" title="Опубликовать ссылку во ВКонтакте" onclick="window.open(this.href, 'Опубликовать ссылку во Вконтакте', 'width=800,height=300'); return false"></a>
.links a:hover.fa-odnoklassniki {
background: #F6881F
}
.links a:hover.fa-vk {
background: #5B7FA6
}
Answer the question
In order to leave comments, you need to log in
<a href="https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=<?php the_permalink(); ?>" target="_blank" class="ok" title="Опубликовать ссылку в Одноклассники" onclick="window.open(this.href, 'Опубликовать ссылку в Одноклассники', 'width=800,height=300'); return false"></a>
<a href="https://vk.com/share.php?url=<?php the_permalink(); ?>" class="vkontakte" title="Опубликовать ссылку во ВКонтакте" onclick="window.open(this.href, 'Опубликовать ссылку во Вконтакте', 'width=800,height=300'); return false"></a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question