Saturday, June 30, 2012

Gắn hình ảnh cho bài đăng mới nhất

Bước 1: Thêm đoạn mã dưới đây vào trước thẻ ]]></b:skin> trong template của bạn.
#Blog1{position:relative}
Bước 2: Tìm thẻ <a expr:name='data:post.id'/> và thêm vào sau nó 1 trong những đoạn mã sau, mỗi đoạn mã ứng với 1 hình ảnh hiển thị bên cạnh bài đăng mới nhất.

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:if cond='data:post.isFirstPost == &quot;true&quot;'>
<img alt='new' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic5bfkrvQ20j9x-R3-oXcs0VQzhToFgxDnDeRCBbr7xqtV7vQliXEcSS5tLBwKtV1Cbv240t10iV3whutK4EPrfteiiWR3cHNAu-jO5NasEHVMSV8zzgQ5eAFPw3bXyP57GAyxXDcbkqOf/s1600/new-red.png' style='display:block;position:absolute;top:24px;left:-24px;border:0 none'/>
</b:if>
</b:if>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:if cond='data:post.isFirstPost == &quot;true&quot;'>
<img alt='new' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwu83w1KzUt9H0Dh0et7ng9Y6MxV2AG1OdT9KJkB50S60RzicQHv_7IDfL1hchthF5nC7Wg2iZixRRvxkvoEH64WjE93OtFKgldQtp26RkIa23n_OC3IKEML1s3zo9TntidVgPxJswO9b8/s1600/new-yellow.png' style='display:block;position:absolute;top:24px;left:-24px;border:0 none'/>
</b:if>
</b:if>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:if cond='data:post.isFirstPost == &quot;true&quot;'>
<img alt='new' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfMwTMzSOETZq5TKTV822X_vAjcUwrP0kAg5wn9BtCLKHyxhBqCwdKtDa6CD7BztjJeOE6Rb0Ax9cRKPhcw3Q8pEe5H6fyrjbgWtDweLIjLriXD2uaFKGM7c6AUohUT-1q1o-c-kiSnzIe/s1600/new-green.png' style='display:block;position:absolute;top:24px;left:-24px;border:0 none'/>
</b:if>
</b:if>
Ảnh được hiển thị góc trên bên trái của bài đăng mới nhất. Bạn cần chỉnh lại giá trị của thuộc tính top và left ở bước 2 để hình ảnh được hiển thị phù hợp với template đang dùng. Nếu có thể, hãy design một hình ảnh cho riêng mình và thay thế cho hình ảnh của thủ thuật trên.

Thủ thuật này không dựa vào giá trị thời gian nên khi duyệt theo label sẽ không gắn hình ảnh cho bài đăng mới nhất.
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

 
© 2025 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