Lần này Chu Bằng AiTi sẽ hướng dẫn các bạn tạo widget bài đăng phổ biến cho blog dạng 5 sao thật hấp dẫn cho blogger. Bắt tay vào làm luôn
Tạo Bài Đăng Phổ Biến Với Sao Vàng

1. Đầu tiên muôn thưở là vào Blogger -> mẫu -> Chỉnh sửa HTML

2. Sau đó tìm thẻ đóng </head> rồi chèn toàn bộ code sau vào trước một trong hai thẻ đóng đó
1<link href='//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css' rel='stylesheet'/>
Các bạn nên tìm xem trong blog mình đã có chưa nếu có rồi thì bỏ qua bước này nha
3. Sau đó các bạn lại tìm tiếp thẻ đóng </style> hoặc ]]></b:skin> rồi chèn toàn bộ code sau vào trước một trong hai thẻ đóng đó 
1/* Popular Post */
.PopularPosts ul{background:#fff;list-style:none;margin:0;padding:5px 5px 0;overflow:hidden;border-top:none}
.PopularPosts li,.PopularPosts li img,.PopularPosts li a,.PopularPosts li a img{margin:0;padding:0;list-style:none;border:none;background:none;outline:none}
.PopularPosts ul{margin:0;list-style:none;color:#64707a}
.PopularPosts ul li img{background:#fafafa;display:block;margin:0 10px 0 0;width:60px;height:60px;overflow:hidden;float:left;}
.PopularPosts ul li{position:relative;background-color:#fff;margin:0;padding:.7em 0!important;border:0;position:relative;border-bottom:1px dotted rgba(0,0,0,0.2)}
.PopularPosts ul li:before{font-family:fontawesome;content:'\f005\f005';display:inline-block;position:absolute;color:#f39c12;text-align:center;bottom:0;right:0;margin:9px 0;font-size:11px;padding:0;font-weight:normal;line-height:normal;transition:all .3s}
.PopularPosts ul li:nth-child(1):before{font-family:fontawesome;content:'\f005\f005\f005\f005\f005';}
.PopularPosts ul li:nth-child(2):before{font-family:fontawesome;content:'\f006\f005\f005\f005\f005';opacity:.9}
.PopularPosts ul li:nth-child(3):before{font-family:fontawesome;content:'\f006\f006\f005\f005\f005';opacity:.85}
.PopularPosts ul li:nth-child(4):before{font-family:fontawesome;content:'\f006\f006\f006\f005\f005';opacity:.8}
.PopularPosts ul li:nth-child(5):before{font-family:fontawesome;content:'\f006\f006\f006\f006\f005';opacity:.75}
.PopularPosts ul li:hover:before{opacity:1}
.PopularPosts ul li:first-child{border-top:none}
.PopularPosts ul li:last-child{border-bottom:none}
.PopularPosts ul li .item-title a,.PopularPosts ul li a{color:#333;font-size:13px;}
.PopularPosts ul li a:hover{color:#2476e0;}
.PopularPosts .item-thumbnail{margin:0;}
.PopularPosts .item-snippet{display:none}
.PopularPosts .item-title{font-weight:700;padding-bottom:.2em;padding:0 5px}
4. Lưu mẫu lại
5. Vào Blogger -> Bố cục -> Thệm tiện ích -> Bài đăng phổ biến rồi chỉnh như hình sau

[Widget] Tạo Bài Đăng Phổ Biến Với Sao Vàng
Chú ý các bạn có thể thay đổi các thông số sau
  • Tên tiêu đề
  • Được xem nhiều nhất (Chọn một trong 3)
  • Hiên thị: chỉ thay đổi cái hiên thị tối đa .... bài đăng, Còn lại giữ nguyên hiện trường. 
Các bạn thay code sau nếu thích để thay cái 5 sao. Tức là cái trên khi áp dụng thì sẽ có 5 sao vàng, xuống tiếp là 5 sao 4 vàng 1 trắng, xuống tiếp là 3 vàng 2 trắng. Còn dùng code này sẽ hiên thị 5 sao > 4sao >3 sao> 2sao,... không có sao trắng.

Các bạn thay đoạn CSS trên bằng code CSS sau
1/* Popular Post */
.PopularPosts ul{background:#fff;list-style:none;margin:0;padding:5px 5px 0;overflow:hidden;border-top:none}
.PopularPosts li,.PopularPosts li img,.PopularPosts li a,.PopularPosts li a img{margin:0;padding:0;list-style:none;border:none;background:none;outline:none}
.PopularPosts ul{margin:0;list-style:none;color:#64707a}
.PopularPosts ul li img{background:#fafafa;display:block;margin:0 10px 0 0;width:60px;height:60px;overflow:hidden;float:left;}
.PopularPosts ul li{position:relative;background-color:#fff;margin:0;padding:.7em 0!important;border:0;position:relative;border-bottom:1px dotted rgba(0,0,0,0.2)}
.PopularPosts ul li:before{font-family:fontawesome;content:'\f005\f005';display:inline-block;position:absolute;color:#f39c12;text-align:center;bottom:0;right:0;margin:9px 0;font-size:11px;padding:0;font-weight:normal;line-height:normal;transition:all .3s}
.PopularPosts ul li:nth-child(1):before{font-family:fontawesome;content:'\f005\f005\f005\f005\f005';}
.PopularPosts ul li:nth-child(2):before{font-family:fontawesome;content:'\f005\f005\f005\f005';opacity:.9}
.PopularPosts ul li:nth-child(3):before{font-family:fontawesome;content:'\f005\f005\f005';opacity:.85}
.PopularPosts ul li:nth-child(4):before{font-family:fontawesome;content:'\f005\f005';opacity:.8}
.PopularPosts ul li:nth-child(5):before{font-family:fontawesome;content:'\f005';opacity:.75}
.PopularPosts ul li:hover:before{opacity:1}
.PopularPosts ul li:first-child{border-top:none}
.PopularPosts ul li:last-child{border-bottom:none}
.PopularPosts ul li .item-title a,.PopularPosts ul li a{color:#333;font-size:13px;}
.PopularPosts ul li a:hover{color:#2476e0;}
.PopularPosts .item-thumbnail{margin:0;}
.PopularPosts .item-snippet{display:none}
.PopularPosts .item-title{font-weight:700;padding-bottom:.2em;padding:0 5px}

Lời Kết

Vậy là mình đã hướng dẫn các bạn Tạo Bài Đăng Phổ Biến Với Sao Vàng, nếu có thắc mắc các bạn cứ comment bên dưới hoặc liên hệ mình, mình sẽ giải đáp. Chúc các bạn thành công
Next
Bài Đăng Phổ Biến Nhiều Màu Sắc Cho Blogger - Blogspot 1. Các bạn vào Blogger -> Mẫu -> Chỉnh sửa html2. Tiếp tục các bạn tìm thẻ đóng ]]> hay thẻ đóng và đặt đoạn CSS sau vào trước thẻ đóng đó CSS/* Popular Posts */.PopularPosts .item-thumbnail{float:none;margin:0 0 10px}.PopularPosts .item-title{background:rgba(0,0,0,0.5);position:absolute;display:block;clear:both;z-index:50;top:0;left:0;right:0;bottom:0;padding:15px;transition:all .4s;}.PopularPosts .item-title:hover{background:rgba(0,0,0,.2)}.PopularPosts .item-title a{color:rgba(255,255,255,0);font-weight:700;font-size:120%;text-shadow:0 0 5px rgba(0,0,0,0)}.PopularPosts .item-title:hover a,.PopularPosts .item-title a:hover{color:rgba(255,255,255,1);text-shadow:0 0 5px rgba(0,0,0,.3)}.PopularPosts .widget-content ul li img{translate(0,0) scale(1.0);transition:all .8s linear}.PopularPosts .widget-content ul li:hover img{transform:translate(0,-20px) scale(1.05);transition:all 3.6s linear;}.PopularPosts img{display:block;height:auto;width:100%;padding:0;backface-visibility:hidden;}.PopularPosts .item-snippet{display:none;}.PopularPosts ul li .item-content{position:relative;overflow:hidden;}.PopularPosts ul{padding:0;line-height:normal;counter-reset:count;}.PopularPosts .widget-content ul li{position:relative;padding:10px 0;overflow:hidden;max-height:100px;transition:all .4s;}.PopularPosts .widget-content ul li:before{color:#fff;counter-increment:count;content:counter(count);position:absolute;right:-15px;top:-5px;font:bold 80px/1 Sans-Serif;z-index:51;transition:all .4s;}.PopularPosts .widget-content ul li:hover:before{right:-55px;}.PopularPosts ul li:nth-child(1) .item-title {background:rgba(221,25,29,0.5);}.PopularPosts ul li:nth-child(2) .item-title {background:rgba(141,187,144,0.5);}.PopularPosts ul li:nth-child(3) .item-title {background:rgba(39,169,255,0.5);}.PopularPosts ul li:nth-child(4) .item-title {background:rgba(192,202,51,0.5);}.PopularPosts ul li:nth-child(5) .item-title {background:rgba(26,35,126,0.5);}.PopularPosts ul li:nth-child(6) .item-title {background:rgba(0,188,212,0.5);}.PopularPosts ul li:nth-child(1) .item-title:hover,.PopularPosts ul li:nth-child(2) .item-title:hover,.PopularPosts ul li:nth-child(3) .item-title:hover,.PopularPosts ul li:nth-child(4) .item-title:hover,.PopularPosts ul li:nth-child(5) .item-title:hover,.PopularPosts ul li:nth-child(6) .item-title:hover{background:rgba(0,0,0,0.2);}Lưu ý: Các bạn nên xóa hết các Css liên quan đến Popular Post cũ trước nha. Nếu các bạn không biết thì tìm kiếm với từ Popular là ra3. Tiếp các bạn dán đoạn javascript sau vào trước thẻ đóng JS4. Save Template (Lưu Mẫu) lại 5. Để thưởng thức thành quả thì các bạn vào Blogger -> Bố cục -> Thêm tiện ích ->Bài đăng phổ biến -> chỉnh các thông số như hình:Chú ý: các bạn có thế thay đổi các thông số sauTiêu ĐềHiện thị tối đa .... bài đăngNếu các bạn ko muốn hiện thị màu- Từ đoạn code CSS trên các bạn xóa toàn bộ chữ có màu xanh lá cây là xong Mặc định hiên thị quá 6 bài sẽ mất màu sắc, vì vậy nếu bạn chỉnh nhiều hơn 6 bài thì các bạn phài thêm mã màu cho bài thứ 7 trở đi- Cũng ỡ đoạn code CSS trên các bạn thêm sau vào sau dòng .PopularPosts ul li:nth-child(6) .item-title {background:rgba(0,188,212,0.5);}CSS.PopularPosts ul li:nth-child(7) .item-title {background:rgba(0,188,212,0.5);}Các bạn thay mã màu có chữ đỏ thành mả màu bạn muốn (mã màu định dạng ở rgba nha) Tương tự cho bài 8, thay số 7 thành 8, bài 9, bài 10Để hiển thị được - Các bạn thêm dòng sauCSS.item-title:hover,.PopularPosts ul li:nth-child(7)vào trong đoạn sauCSS.PopularPosts ul li:nth-child(1) .item-title:hover,.PopularPosts ul li:nth-child(2) .item-title:hover,.PopularPosts ul li:nth-child(3) .item-title:hover,.PopularPosts ul li:nth-child(4) .item-title:hover,.PopularPosts ul li:nth-child(5) .item-title:hover,.PopularPosts ul li:nth-child(6) .item-title:hover{background:rgba(0,0,0,0.2);}Sau đó nó sẽ thành như thế này:CSS.PopularPosts ul li:nth-child(1) .item-title:hover,.PopularPosts ul li:nth-child(2) .item-title:hover,.PopularPosts ul li:nth-child(3) .item-title:hover,.PopularPosts ul li:nth-child(4) .item-title:hover,.PopularPosts ul li:nth-child(5) .item-title:hover,.PopularPosts ul li:nth-child(6) .item-title:hover,.PopularPosts ul li:nth-child(7) .item-title:hover{background:rgba(0,0,0,0.2);}
Previous
Chèn Comments Facebook Responsive Cho Blogger
Axact

Chu Bằng Monkey

Tôi là Chu Bằng, tôi đang làm và phát triển tại KenhVietPro.Blogspot.Com.
Tôi yêu thích lập trình Wap/Web và chia sẻ code , kiến thức IT.

Nhận Xét:

0 comments: