Tạo link RSS nằm sau mỗi nhãn ở cuối bài viết


Bài viết này có thể xem là một ứng dụng nho nhỏ cho việc sử dụng các link RSS feed của mỗi nhãn. Với thủ thuật này ta sẽ tạo một icon RSS nho nhỏ nằm ngay sau mỗi nhãn ở cuối mỗi bài viết.

Thủ thuật này rất đơn giản, bạn chỉ việc thêm một dòng code nho nhỏ vào code template của blog là xong.

Xem hình minh họa kết quả

* Bây giờ ta bắt đầu:

1. Đăng nhập blog
2. Vào Thiết kế
3. Vào Chỉnh sửa HTML
4. Chọn Mở rộng mẫu tiện ích
5. Tìm đọan code sau: (hoặc tương tự)

<div class='post-footer-line post-footer-line-2'>
<span class='post-labels'>
<b:if cond='data:post.labels'>
<data:postLabelsLabel/>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a>
<b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
</b:loop>
</b:if>
</span>
</div>

6. Chèn thêm đọan code như bên dưới:

<div class='post-footer-line post-footer-line-2'>
<span class='post-labels'>
<b:if cond='data:post.labels'>
<data:postLabelsLabel/>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a>

<a expr:href='&quot;http://fandung.blogspot.com/feeds/posts/type/-/&quot; + data:label.name' target='_blank'><img src='http://www.feedburner.com/fb/images/pub/feed-icon16x16.png'/></a>

<b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
</b:loop>
</b:if>
</span>
</div>

- Thay fandung.blogspot.com thành địa chỉ URL blog của bạn.
- Thay type thành :
  + default : hiển thị theo dạng mặc định ( đầy đủ )
  + summary : hiển thị theo dạng thu gọn ( chỉ hiển thị một phần theo kiểu mô tả )

7.Save template.

Như vậy đã xong, chúc các bạn thành công.

FanDung

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com