Thêm Google+ Button & Social Networking Buttons dưới tiêu đề bài viết


#Cách thực hiện

1. Đăng nhập Blogger > Mẫu > Chỉnh sửa HTML
2. Tìm đoạn code dưới
<b:if cond='data:post.title'>
      <h2 class='post-title entry-title' itemprop='name'>
      <b:if cond='data:post.link'>
        <a expr:href='data:post.link'><data:post.title/></a>
      <b:else/>
        <b:if cond='data:post.url'>
          <b:if cond='data:blog.url != data:post.url'>
            <a expr:href='data:post.url'><data:post.title/></a>
          <b:else/>
            <data:post.title/>
          </b:if>
        <b:else/>
          <data:post.title/>
        </b:if>
      </b:if>
      </h2>
    </b:if>
Lưu ý :
  • Để tìm đoạn ở bước 2 thì chỉ cần tìm đoạn dưới, khi tìm sẽ có hai đoạn như vậy và chúng ta cần đoạn thứ 2.
<h2 class='post-title entry-title' itemprop='name'>
  • h2 có thể là h3
3. Dán code này dưới đoạn code tìm được ở bước 2
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<table border='0'>
<tr> <td> <a class='twitter-share-button' data-count='horizontal' data-lang='en'  data-via='chelskivn29' expr:data-text='data:post.title' expr:data-url='data:post.url' href='http://twitter.com/share' rel='nofollow'/> <b:if cond='data:post.isFirstPost'> <script src='http://platform.twitter.com/widgets.js' type='text/javascript'> </script> </b:if> </td>
<td> <iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.url + &quot;&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp; action=like&amp;font=arial&amp;colorscheme=light&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; margin-left:20px; width:100px; height:20px;'/> </td>
<td><div style='margin-right:25px;'> <script expr:src='&quot;http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=&quot; + data:post.url'/></div> </td>
<td><div style='margin-right:5px;'> <g:plusone expr:href='data:post.url' size='medium'/> </div> </td>
<td> <!-- AddThis Button BEGIN --> <div class='addthis_toolbox addthis_default_style '> <a class='addthis_counter addthis_pill_style'/> </div> <script src='http://s7.addthis.com/js/250/addthis_widget.js' type='text/javascript'/>
<script type='text/javascript'> var addthis_config = { ui_cobrand: &quot;MY BLOGGER TRICKS&quot;, ui_header_color: &quot;#ffffff&quot;, ui_header_background: &quot;#0080FF&quot; } </script> <!-- AddThis Button END --></td>
</tr> </table>
</b:if><br/>

  • Cập thẻ b:if sẽ làm cho nút like không hiện ở trang chủ
  • Thay chelskivn29 thành tên Twitter

4. Nếu bạn đã có nút G+ thì bỏ qua bước này. Tìm thẻ </head> và dán scrip sau vào trên nó.
script src='http://apis.google.com/js/plusone.js' type='text/javascript'> {lang: &#39;en-US&#39;} </script>
5. Save và xem kết quả.
Nguồn Mybloggertrick

Comments