Rút gọn bài đăng cho blogger đẹp mắt hơn


Thông thường trang chủ blog sẽ hiển thị hết toàn bộ nội dung đối với mỗi bài viết.Để cho blog trông đẹp mắt hơn với cách hiển thị chỉ có tiêu đề và 1 phần nộj dung bài đăng đó ta sẽ thực hiện 1 vài thao tác đơn giản sau.
Vào Layout –>chọn Edit HTML check vào “expand widget templates”.Sau đó ta tìm thẻ </head> chèn đoạn code dưới vào phía trên nó:
(Nếu là phiên bản tiếng việt  thì vào : Thiết kế --> Chỉnh sửa HTML )
<script language='javascript' src='http://sites.google.com/site/love4all1080/Home/jquery-1.2.3.pack.txt?attredirects=0' type='text/javascript'/>
<script language='javascript' src='http://sites.google.com/site/love4all1080/Home/jquery.extractor.txt?attredirects=0' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function() {
$('.excerpt').expander({
slicePoint: 450, // default is 100
expandEffect: 'fadeIn',
expandText: '[...]', // default is 'read more...'
userCollapseText: '[^]' // default is '[collapse expanded text]'
});
});
</script>
Sau đó tìm đoạn code giống như bên dưới
<div class='post-body entry-content'>
<data:post.body/>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
Và thay thế cả đoạn đó bằng đoạn code
<b:if cond='data:blog.pageType != "item"'>
<div class='excerpt post-body entry-content'>
<data:post.body/>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
<a expr:href="data:post.url">Read More..</a>
<b:else/>
<div class='post-body entry-content'>
<data:post.body/>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
</b:if>

(Nguồn: Sư tầm)

Đăng nhận xét

Không cho phép có nhận xét mới.*

Mới hơn Cũ hơn