20 Şubat 2017 Pazartesi

WordPress Sosyal Medya Paylaş Butonları

WordPress için Kod Kullanmadan Sosyal Medya Paylaş Butonu eklentisiz.

WordPress için eklentisiz sosyal medya paylaşım butonları ararken, oldukça güzel bir kod ile karşılaştım.

Aşağıda yer alan kodlar sayesinde sizler de yazılarınız için Facebook, Twitter ve Google+ paylaş butonları ekleyebilirsiniz.
Bunu hem eklentisiz yapmak sitemize ek yük binmesini engelleyecek, hem de daha hızlı bir sonuca ulaşmış olacağız.



Tekil Yazı (single.php) dosyasını açınız,

the_content(); altına ve ya endwhile; else: üstüne aşağıdakı kodları yapıştırın.

<p><center><span class="tavsiye"><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:130px; height:20px"></iframe></span>
<span class="begen"><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;colorscheme=light" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:130px; height:20px"></iframe></span>
<span class="twit"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></span>
<span class="birle"><g:plusone size="medium"></g:plusone></span>
<span class="liked"><script src="//platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-counter="right"></script></span>
<span class="pint"><a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); echo $thumb['0']; ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal" target="_blank"><img border="0" src="//assets.pinterest.com/images/PinExt.png" alt="Pin It" /></a></span></center></p>
]

Kodlar içinde gerekli CSS kodlamaları yapıldığı için CSS dosyanıza kod eklemenize gerek yoktur. temanız ve yaz sayfanız bozulmayacaktır.

Yinede eklemek isterseniz CSS Kodları

/*sosyal medya paylas butonlari basladi*/
/** Facebook tavsiye **/
.tavsiye a{
display:inline-block;
margin:10px 10px 5px 0;
padding:10px 15px;
color:#fff;
font-weight:bold;
text-align:center;
text-decoration:none;
border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
-webkit-border-radius:5px;
-ms-border-radius:5px;
}
/** Facebook begen **/
.begen a{
display:inline-block;
margin:10px 10px 5px 0;
padding:10px 15px;
color:#fff;
font-weight:bold;
text-align:center;
text-decoration:none;
border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
-webkit-border-radius:5px;
-ms-border-radius:5px;
}
/** Twitter **/
.twit{
background:#9AE4E8;
}
/*Linkedin*/
.liked{
background:#3B5998;
}
/*Google Plus*/
.birle{
background:#D34836;
}
/*Pinterest*/
.pint{
background:#D34836;
}
/*sosyal medya paylas butonlari bitti*/

0 yorum:

Yorum Gönder