--------------- CHIA SẺ CÔNG NGHỆ - KẾT NỐI ĐAM MÊ ----------------

--------------- CHIA SẺ CÔNG NGHỆ - KẾT NỐI ĐAM MÊ ----------------

Tạo tin liên quan trong blogspot với ảnh thumnail

Để blog của bạn trở nên sinh động và dễ dàng giới thiệu những bài viết hay đến cho nhiều người thì tin liên quan là thứ không thể thiếu cho blog của bạn, có rất nhiều cách để làm điều đó, hôm nay mình xin giới thiệu cách tạo tin liên quan với hình ảnh thumnail của bài viết hiện tại, các tin liên quan này sẽ hiển thị ở dưới cùng bài viết và được chọn cùng danh mục , label và tag của bài viết đó. Như hình mình họa dưới đây:
blogspot tips, relate post, thu thuat blogspot, thumnail, tin lien quan

Các bạn chỉ cần làm theo các bước sau đây :
Bước 1 : Đăng nhập vào Blogger : Dashboard >>Design >>Edit HTML;
Bước 2 : Click chọn ” Expand widgets template “.
Bước 3 : Tìm đoạn code
?
1
</head>
Sau đó copy và paste đoạn code sau ngay trên thẻ </head>
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!--Related Posts with thumbnails Scripts and Styles Start-->
 
<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>
 
<style type="text/css">
 
#related-posts {
 
float:center;
 
text-transform:none;
 
height:100%;
 
min-height:100%;
 
padding-top:5px;
 
padding-left:5px;
 
}
 
 
 
#related-posts h2{
 
font-size: 1.6em;
 
font-weight: bold;
 
color: black;
 
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
 
margin-bottom: 0.75em;
 
margin-top: 0em;
 
padding-top: 0em;
 
}
 
#related-posts a{
 
color:black;
 
}
 
#related-posts a:hover{
 
color:black;
 
}
 
 
 
#related-posts  a:hover {
 
background-color:#d4eaf2;
 
}
 
</style>
 
<script type='text/javascript'>
 
 
var maxresults=5;
 
var splittercolor="#d4eaf2";
 
var relatedpoststitle="Related Posts";
 
</script>
 
 
<!-- remove --></b:if>
 
<!--Related Posts with thumbnails Scripts and Styles End-->
Đoạn code trên sẽ hiển thị mặc định là 5 tin liên quan, nếu bạn muốn hiển thị nhiều hay ít hơn thì có thể điều chỉnh ở dòng var maxresults=5;
Bước 5 : Bây giờ các bạn nhấn Ctrl + F và  tìm đoạn code sau :
?
1
<div class='post-footer-line post-footer-line-1'>
Nếu các bạn không tìm thấy thì tìm đoạn này :
?
1
<p class='post-footer-line post-footer-line-1'>
Hoặc :
?
1
<data:post.body/>
Bước 6 : Copy và paste đoạn code bên dưới ngay dưới những đoạn code mà chúng ta tìm thấy ở bước 5
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- Related Posts with Thumbnails Code Start-->
 
<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>
 
<div id='related-posts'>
 
<b:loop values='data:post.labels' var='label'>
 
<b:if cond='data:label.isLast != &quot;true&quot;'>
 
</b:if>
 
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels_thumbs&amp;max-results=5&quot;' type='text/javascript'/></b:loop>
 
<script type='text/javascript'>
 
removeRelatedDuplicates_thumbs();
 
printRelatedLabels_thumbs(&quot;<data:post.url/>&quot;);
 
</script>
 
</div><div style='clear:both'/>
 
<!-- remove --></b:if>
 
<b:if cond='data:blog.url == data:blog.homepageUrl'><b:if cond='data:post.isFirstPost'>
 
 
</b:if></b:if>
 
<!-- Related Posts with Thumbnails Code End-->
Chú ý :  Thay đổi giá trị 5 từ max-results=5 với số bài viết mà bạn muốn hiển thị
Bước 7  : nhất nút Save để kết thúc.
Share on Google Plus

Admin Admin

Một số bài đăng trong blog có sử dụng nhiều nguồn thông tin khác nhau nên dễ xảy ra vấn đề trùng bài hoặc vi phạm bản quyền, mong các bạn thông cảm. Nếu phát hiện bài đăng vi phạm bản quyền vui lòng comment ngay bên dưới để được hỗ trợ tốt nhất ! Xin cảm ơn và chúc các bạn có trải nghiệm vui vẻ tại blog :)
    Blogger Comment
    Facebook Comment

0 nhận xét: