Thursday, June 7, 2012

Chèn Icon vào Tiêu đề bài viết tương ứng với mỗi Tag (Nhãn)

  • Chọn: Design (Thiết kế) > Edit HTML (Chỉnh sữa HTML) 
  • Đánh dấu chọn ô: Expand Widget Templates (Mở rộng mẫu tiện ích) 
  • Nhấn tổ hợp phím Ctrl +F và thực hiện theo các bước sau:
Bước 1: Tìm dòng ]]></b:skin> 
và chèn trước nó đoạn code sau:
.post-icon img {
float:left;
margin-right:8px;
}
Bước 2: Tiếp tục tìm đến đoạn code 
<b:if cond='data:post.title'>
<h3 class='post-title entry-title'>
<b:if cond='data:post.link'>
<a expr:href='data:post.link'><data:post.title/></a>
<b:else/>
<b:if cond='data:post.url'>
<a expr:href='data:post.url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</b:if>
</h3>
</b:if>
Chèn vào sau cái dòng <h3 class='post-title entry-title'> đoạn code sau:
<div class='post-icon'>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>

<b:if cond='data:label.name == "Tên_Label_1"'>
<img src='LINK_HÌNH'/>
</b:if>

<b:if cond='data:label.name == "Tên_Label_2"'>
<img src='LINK_HÌNH'/>
</b:if>
...
<b:if cond='data:label.name == "Tên_Label_N"'>
<img src='LINK_HÌNH'/>
</b:if>

</b:loop>
</b:if>
</div>
***Chú ý:
  1. Tên_Label = Tên Tag (nhãn) bạn muốn chèn hình
  2. Link_hình  = Địa chỉ Url hình ảnh bạn muốn chèn
  3. "..." = Bạn có thể thêm nhiều hơn các Label bạn muốn chèn hình bằng cách thêm nhiều đoạn code sau vào "..." đó.
<b:if cond='data:label.name == "Tên_Label"'>
<img src='LINK_HÌNH'/>
</b:if>
Bước 4: Save template. (Lưu mẫu)
( Nguồn: caytamgui )
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 nhận xét

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© Sổ ghi chú
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top