Как добавить кнопки социальных сервисов на свой блог Печать
23.03.11 15:20

Как добавить кнопки социальных сервисов на свой блог

 

 

Эти коды добавляются в файле single.php (в некоторых темах его нет, тогда используйте файл index.php) в папке с темой вашего блога wp-content/themes/ваша_тема/ после этого участка:

<?php the_content(”); ?>

Cсылку @shakinru в коде кнопки Твиттера замените на свою.

Кнопка добавления в Twitter:

  1. <noindex><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=RT @shakinru <?php the_title(); ?>: <?php the_permalink(); ?>" title="Добавить в Twitter"><img src="/<?php bloginfo('template_url'); ?>/images/twitter.gif" alt="Опубликовать в twitter.com" width="78" height="18"></a></noindex>
<noindex><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=RT @shakinru <?php the_title(); ?>: <?php the_permalink(); ?>" title="Добавить в Twitter"><img src="/<?php bloginfo('template_url'); ?>/images/twitter.gif" alt="Опубликовать в twitter.com" width="78" height="18"></a></noindex>

Кнопка добавления в ВКонтакте:

  1. <noindex><a href="http://vkontakte.ru/share.php?url=<?php the_permalink(); ?>" target="_blank" rel="nofollow"><img src="/<?php bloginfo('template_url'); ?>/images/vkontakte.gif" width="84" height="18" title="Поделиться ВКонтакте"></a></noindex>
<noindex><a href="http://vkontakte.ru/share.php?url=<?php the_permalink(); ?>" target="_blank" rel="nofollow"><img src="/<?php bloginfo('template_url'); ?>/images/vkontakte.gif" width="84" height="18" title="Поделиться ВКонтакте"></a></noindex>

Кнопка добавления в Facebook:

  1. <noindex><a rel="nofollow" target="blank" href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"><img src="/<?php bloginfo('template_url'); ?>/images/facebook.gif" width="73" height="18" title="Поделиться в Facebook"></a></noindex>
<noindex><a rel="nofollow" target="blank" href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"><img src="/<?php bloginfo('template_url'); ?>/images/facebook.gif" width="73" height="18" title="Поделиться в Facebook"></a></noindex>

Кнопка добавления в Google Buzz:

  1. <noindex><a href="http://www.google.com/reader/link?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&srcURL=http://shakin.ru/" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/google-buzz-compact.gif" width="73" height="18" title="Добавить в Google Buzz"></a></noindex>
<noindex><a href="http://www.google.com/reader/link?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&srcURL=http://shakin.ru/" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/google-buzz-compact.gif" width="73" height="18" title="Добавить в Google Buzz"></a></noindex>

Кнопка добавления в Мой Мир:

  1. <noindex><a target="_blank" rel="nofollow" href="http://connect.mail.ru/share?share_url=<?php the_permalink(); ?>"><img src="/<?php bloginfo('template_url'); ?>/images/moi-mir.gif" width="86" height="18" title="Поделиться В Моем Мире"></a></noindex>
<noindex><a target="_blank" rel="nofollow" href="http://connect.mail.ru/share?share_url=<?php the_permalink(); ?>"><img src="/<?php bloginfo('template_url'); ?>/images/moi-mir.gif" width="86" height="18" title="Поделиться В Моем Мире"></a></noindex>

Кнопка добавления в Livejournal:

  1. <noindex><a rel="nofollow" href="http://www.livejournal.com/update.bml?event=<?php the_permalink(); ?>&subject=<?php the_title(); ?>" target="_blank" title="Опубликовать в своем блоге livejournal.com"><img src="/<?php bloginfo('template_url'); ?>/images/livejournal.gif" alt="Опубликовать в своем блоге livejournal.com" width="73" height="18"></a></noindex>
<noindex><a rel="nofollow" href="http://www.livejournal.com/update.bml?event=<?php the_permalink(); ?>&subject=<?php the_title(); ?>" target="_blank" title="Опубликовать в своем блоге livejournal.com"><img src="/<?php bloginfo('template_url'); ?>/images/livejournal.gif" alt="Опубликовать в своем блоге livejournal.com" width="73" height="18"></a></noindex>

Данные коды кнопок лучше добавлять так:

<div class=”buttons”>
коды кнопок
</div>

Это позволит легко задать нужный стиль оформления всему блоку с кнопками через файл стилей style.css.

 

<table border="0" frame="void" align="center">
<tbody>
<tr style="text-align: center;">
<td>
<div><a name="fb_share" href="http://www.facebook.com/sharer.php">Опубликовать</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</div>
</td>
<td>
<div><!-- Put this script tag to the       
<head>
of your page -->
<script src="http://vkontakte.ru/js/api/share.js?10" type="text/javascript"></script>
<!-- Put this script tag to the place, where the Share button will be -->
<script type="text/javascript">// <![CDATA[
document.write(VK.Share.button(false,{type: "round", text: "vkontakte"}));
// ]]></script>
</div>
</td>
</tr>
</tbody>
</table>

 

div>

Приглашаю присоединиться ко мне в следующих сервисах:<br>

<noindex><a href="http://twitter.com/shakinru" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/twitter-32.png" title="Присоединиться в Твиттере" width="32" height="32"></a></noindex>

<noindex><a href="http://vkontakte.ru/id80770238" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/vkontakte-32.png" title="Присоединиться ВКонтакте" width="32" height="32"></a></noindex>

<noindex><a href="http://www.facebook.com/profile.php?id=100000550459738" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/facebook-32.png" title="Присоединиться в Facebook" width="32" height="32"></a></noindex>

<noindex><a href="http://www.google.com/profiles/116781296520179206529" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/google-buzz-32.png" title="Присоединиться в Google Buzz" width="32" height="32"></a></noindex>

<noindex><a href="http://friendfeed.com/shakinru" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/friendfeed-32.png" title="Присоединиться во FriendFeed" width="32" height="32"></a></noindex>

<noindex><a href="http://shakinru.livejournal.com/" rel="nofollow" target="_blank"><img src="/<?php bloginfo('template_url'); ?>/images/livejournal-32.png" title="Присоединиться в Livejournal" width="32" height="32"></a></noindex>

</div>

 

оригинал http://shakin.ru/other/social-buttons.html

 

{jcomments on}