Đang tải cột 1…
Đang tải cột 2…

Tạo chuyên mục cho bài viết theo nhãn Blogger v3

Đã đọc 0%

Tạo chuyên mục cho bài viết theo nhãn Blogger v3

✦ Góc nhìn mới, trải nghiệm đọc khác biệt
Cỡ chữ16px

Nếu bạn đang dùng Blogger và muốn trang chủ trông gọn gàng, chuyên nghiệp như một trang báo điện tử thay vì chỉ hiện một danh sách bài viết dài nối tiếp nhau, tiện ích Tạo chuyên mục cho bài viết theo nhãn Blogger v3 chính là giải pháp dành cho bạn. Chỉ cần gắn nhãn (Label) cho từng bài viết như Thủ thuật, Công nghệ, Giải trí…, tiện ích sẽ tự động gom và trình bày các bài viết đó thành từng khung chuyên mục riêng biệt ngay trên trang chủ.

So với các phiên bản trước đây, bản mới được viết lại hoàn toàn để khắc phục mọi điểm yếu về giao diện điện thoại và tốc độ tải trang, giúp ngay cả người không rành về code cũng có thể tự cài đặt dễ dàng:

Các tính năng

  • 100% Responsive: trên mọi màn hình: Tự động sắp xếp lại bố cục gọn gàng khi xem trên máy tính, máy tính bảng hay điện thoại, không còn tình trạng vỡ khung hay tràn chữ.
  • Dùng Shortcode tiện lợi: Thay vì phải vào chỉnh sửa mã nguồn Template phức tạp mỗi lần muốn thêm hay đổi chuyên mục, giờ bạn chỉ cần dán một dòng lệnh ngắn (ví dụ [chuyenmuc label="Thủ Thuật" style="1"]) ngay trong phần Bố cục → HTML/JavaScript, với 6 kiểu trình bày đa dạng để lựa chọn.
  • Tải trang nhẹ và nhanh: Không còn phụ thuộc vào thư viện jQuery nặng nề. Tiện ích chỉ tải bài viết khi người đọc cuộn gần tới chuyên mục đó, kèm khung chờ mượt mà giúp blog mở lên gần như tức thì.
  • Ảnh đại diện luôn sắc nét: Tự động khắc phục lỗi ảnh thumbnail bị mờ, vỡ hạt thường gặp trên Blogger bằng cách lấy ảnh độ phân giải cao chuẩn 16:9 ở định dạng WebP siêu nhẹ.

Cách thực hiện :

Bước 1: Chèn CSS vào Template

  • Vào Chủ đề (Theme) → Chỉnh sửa HTML, tìm thẻ ]]></b:skin> (hoặc </head> nếu dùng thẻ <style>) và dán đoạn CSS dưới đây lên phía trên.
/* ===== Chuyen muc theo nhan Blogger v3 - Responsive & Fast ===== */ .tb-box { --tb-accent: #db614c; --tb-radius: 8px; --tb-border: #e5e7eb; --tb-text: #1f2937; --tb-muted: #6b7280; margin: 0 0 28px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tb-text); box-sizing: border-box; } .tb-box *, .tb-box *::before, .tb-box *::after { box-sizing: border-box; } .tb-box a { color: inherit; text-decoration: none; transition: color .2s ease; } .tb-box a:hover { color: var(--tb-accent); } /* Header & Tab chuyên mục */ .tb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--tb-accent); background: #f8fafc; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; } .tb-head::-webkit-scrollbar { display: none; } .tb-head-left { display: flex; align-items: center; flex-shrink: 0; } .tb-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap; } .tb-title a { display: inline-block; padding: 9px 16px; background: var(--tb-accent); color: #fff !important; } .tb-sublinks { display: flex; align-items: center; gap: 4px; padding-right: 8px; white-space: nowrap; } .tb-sublinks a { padding: 6px 10px; font-size: 13px; font-weight: 600; color: #4b5563; } .tb-sublinks a:hover { color: var(--tb-accent); } /* Ảnh sắc nét chuẩn 16:9 */ .tb-thumb { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--tb-radius); background: #e5e7eb; } .tb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; } .tb-card:hover .tb-thumb img { transform: scale(1.04); } .tb-meta { font-size: 12px; color: var(--tb-muted); margin: 6px 0 4px; } .tb-card-title { margin: 6px 0 0; font-size: 16px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .tb-excerpt { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: #4b5563; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } /* KIỂU 1: 1 bài lớn bên trái + danh sách bài nhỏ bên phải */ .tb-style-1 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; } .tb-style-1 .tb-lead .tb-card-title { font-size: 19px; margin-top: 10px; } .tb-list-sm { display: flex; flex-direction: column; gap: 14px; } .tb-list-sm .tb-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; } .tb-list-sm .tb-card-title { font-size: 14px; margin-top: 0; } .tb-list-sm .tb-meta { margin: 4px 0 0; } /* KIỂU 2: 1 bài nổi bật ngang ở trên + lưới 3 cột bên dưới */ .tb-style-2 { display: flex; flex-direction: column; gap: 18px; } .tb-style-2 .tb-lead { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: center; } .tb-style-2 .tb-lead .tb-card-title { font-size: 20px; margin-top: 0; } .tb-style-2 .tb-subgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .tb-style-2 .tb-subgrid .tb-card-title { font-size: 14.5px; } /* KIỂU 3: Lưới 3 cột đồng đều (Card Grid) */ .tb-style-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; } .tb-style-3 .tb-card { background: #fff; border: 1px solid var(--tb-border); border-radius: var(--tb-radius); overflow: hidden; display: flex; flex-direction: column; } .tb-style-3 .tb-thumb { border-radius: 0; } .tb-style-3 .tb-body { padding: 12px 14px 14px; } .tb-style-3 .tb-card-title { font-size: 15px; margin-top: 0; } /* KIỂU 4: Danh sách tạp chí ngang */ .tb-style-4 { display: flex; flex-direction: column; gap: 16px; } .tb-style-4 .tb-card { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--tb-border); } .tb-style-4 .tb-card:last-child { border-bottom: 0; padding-bottom: 0; } .tb-style-4 .tb-card-title { font-size: 17px; margin-top: 0; } /* KIỂU 5: Lưới ảnh Overlay (thay thế mẫu 500px cũ) */ .tb-style-5 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; } .tb-style-5 .tb-card { position: relative; border-radius: var(--tb-radius); overflow: hidden; } .tb-style-5 .tb-thumb { aspect-ratio: 4 / 3; border-radius: 0; } .tb-style-5 .tb-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .25) 55%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; color: #fff; } .tb-style-5 .tb-card-title { font-size: 15px; color: #fff; margin: 0; } .tb-style-5 .tb-card-title a:hover { color: #fde68a; } .tb-style-5 .tb-meta { color: rgba(255, 255, 255, .82); margin: 4px 0 0; } /* KIỂU 6: Chuyên mục cột đôi song song */ .tb-dual { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 28px; } .tb-dual .tb-box { margin-bottom: 0; } .tb-style-6 { display: flex; flex-direction: column; gap: 14px; } .tb-style-6 .tb-lead .tb-card-title { font-size: 17px; margin-top: 8px; } .tb-style-6 .tb-list-sm { padding-top: 12px; border-top: 1px solid var(--tb-border); } /* Hiệu ứng Skeleton khi đang tải */ .tb-skel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .tb-skel-card { height: 190px; border-radius: var(--tb-radius); background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: tbShimmer 1.2s infinite; } @keyframes tbShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } } .tb-empty { font-size: 14px; color: var(--tb-muted); padding: 12px 0; } /* Responsive Tablet & Mobile */ @media (max-width: 768px) { .tb-style-1, .tb-style-2 .tb-lead, .tb-dual { grid-template-columns: 1fr; } .tb-style-2 .tb-subgrid, .tb-style-3, .tb-style-5, .tb-skel-grid { grid-template-columns: repeat(2, 1fr); } .tb-style-4 .tb-card { grid-template-columns: 150px 1fr; gap: 12px; } } @media (max-width: 520px) { .tb-style-2 .tb-subgrid, .tb-style-3, .tb-style-5, .tb-skel-grid { grid-template-columns: 1fr; } .tb-style-4 .tb-card { grid-template-columns: 1fr; } .tb-list-sm .tb-card { grid-template-columns: 96px 1fr; } }

Bước 2: Chèn JavaScript xử lý Shortcode & Tối ưu tốc độ

  • Tìm thẻ </body> trong Template và dán đoạn mã dưới đây lên phía trên thẻ </body> (đặt cuối trang giúp HTML hiển thị ngay lập tức, không chặn tải trang).
  • Lưu ý: Nếu bạn muốn ẩn danh sách bài viết mặc định (#Blog1) ở trang chủ để chỉ hiện các chuyên mục này, hãy giữ lại đoạn <b:if cond='data:view.isHomepage'>...</b:if> đi kèm bên dưới.
<b:if cond='data:view.isHomepage'> <style type='text/css'>#Blog1{display:none!important}</style> </b:if> <script> /*<![CDATA[*/ (function () { "use strict"; var DEFAULT_COLORS = { "1": "#db614c", "2": "#f0a341", "3": "#316ac5", "4": "#309d86", "5": "#7c3aed", "6": "#316ac5" }; var FALLBACK_IMG = "data:image/svg+xml;charset=UTF-8," + encodeURIComponent( '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 360">' + '<rect width="640" height="360" fill="#e5e7eb"/>' + '<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" ' + 'fill="#9ca3af" font-family="sans-serif" font-size="22">No Image</text></svg>' ); var feedCache = {}; function esc(str) { return String(str || "") .replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;") .replace(/"/g, "&quot;") .replace(/'/g, "&#39;"); } function formatDate(iso) { if (!iso) return ""; var d = new Date(iso); if (isNaN(d.getTime())) return ""; return ( String(d.getDate()).padStart(2, "0") + "/" + String(d.getMonth() + 1).padStart(2, "0") + "/" + d.getFullYear() ); } function getSnippet(entry, maxLen) { var raw = (entry.summary && entry.summary.$t) || (entry.content && entry.content.$t) || ""; var clean = raw.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim(); if (clean.length <= maxLen) return clean; return clean.slice(0, maxLen).replace(/\s+\S*$/, "") + "…"; } function getPostUrl(entry) { var links = entry.link || []; for (var i = 0; i < links.length; i++) { if (links[i].rel === "alternate") return links[i].href; } return "#"; } /* Nâng cấp ảnh Blogger/Google Photos lên WebP sắc nét + Retina 2x */ function resizeGoogleUrl(url, w, h) { if (/img\.youtube\.com\/vi\//.test(url)) { return url.replace(/\/(default|mqdefault)\.jpg/, "/hqdefault.jpg"); } if (/(bp\.blogspot\.com|googleusercontent\.com)/.test(url)) { var param = "w" + w + "-h" + h + "-p-k-no-nu-rw"; if (/\/(s\d+(-c)?|w\d+-h\d+[^/]*)\//.test(url)) { return url.replace(/\/(s\d+(-c)?|w\d+-h\d+[^/]*)\//, "/" + param + "/"); } if (/=(s\d+[^&?]*|w\d+-h\d+[^&?]*)$/.test(url)) { return url.replace(/=(s\d+[^&?]*|w\d+-h\d+[^&?]*)$/, "=" + param); } } return url; } function renderThumb(entry, alt, w, h) { var rawUrl = entry.media$thumbnail && entry.media$thumbnail.url; if (!rawUrl) { return '<img src="' + FALLBACK_IMG + '" alt="' + esc(alt) + '" loading="lazy" decoding="async" width="' + w + '" height="' + h + '">'; } var src1x = resizeGoogleUrl(rawUrl, w, h); var src2x = resizeGoogleUrl(rawUrl, w * 2, h * 2); return ( '<img src="' + esc(src1x) + '" ' + 'srcset="' + esc(src1x) + ' 1x, ' + esc(src2x) + ' 2x" ' + 'alt="' + esc(alt) + '" loading="lazy" decoding="async" ' + 'width="' + w + '" height="' + h + '">' ); } function parseAttrs(raw) { var attrs = {}; var re = /(\w+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g; var m; while ((m = re.exec(raw)) !== null) { attrs[m[1].toLowerCase()] = m[2] !== undefined ? m[2] : m[3]; } return attrs; } function buildHeader(cfg) { var label = cfg.label || ""; var title = cfg.title || label || "Bài viết mới"; var titleUrl = label && label !== "recent" ? "/search/label/" + encodeURIComponent(label) : "/"; var subHtml = ""; if (cfg.links) { var parts = cfg.links.split(","); var items = []; for (var i = 0; i < parts.length; i++) { var seg = parts[i].trim().split("|"); if (seg.length >= 2) { items.push('<a href="' + esc(seg[1].trim()) + '">' + esc(seg[0].trim()) + "</a>"); } } if (items.length) subHtml = '<nav class="tb-sublinks">' + items.join("") + "</nav>"; } return ( '<div class="tb-head">' + '<div class="tb-head-left"><h2 class="tb-title"><a href="' + esc(titleUrl) + '">' + esc(title) + "</a></h2></div>" + subHtml + "</div>" ); } function renderCard(entry, opts) { var url = getPostUrl(entry); var title = (entry.title && entry.title.$t) || "Không tiêu đề"; var date = formatDate(entry.published && entry.published.$t); var w = opts.w || 480; var h = opts.h || 270; var thumb = '<a class="tb-thumb" href="' + esc(url) + '">' + renderThumb(entry, title, w, h) + "</a>"; if (opts.overlay) { return ( '<article class="tb-card">' + thumb + '<div class="tb-overlay">' + '<h3 class="tb-card-title"><a href="' + esc(url) + '">' + esc(title) + "</a></h3>" + (date ? '<div class="tb-meta">' + date + "</div>" : "") + "</div>" + "</article>" ); } var snippet = opts.excerpt ? '<p class="tb-excerpt">' + esc(getSnippet(entry, opts.excerptLen || 115)) + "</p>" : ""; return ( '<article class="tb-card' + (opts.lead ? " tb-lead" : "") + '">' + thumb + '<div class="tb-body">' + '<h3 class="tb-card-title"><a href="' + esc(url) + '">' + esc(title) + "</a></h3>" + (date ? '<div class="tb-meta">' + date + "</div>" : "") + snippet + "</div>" + "</article>" ); } function renderEntries(entries, style) { if (!entries || !entries.length) { return '<div class="tb-empty">Chưa có bài viết nào trong chuyên mục này.</div>'; } var html = ""; if (style === "1") { html = '<div class="tb-style-1">' + renderCard(entries[0], { lead: true, w: 640, h: 360, excerpt: true, excerptLen: 140 }) + '<div class="tb-list-sm">' + entries.slice(1).map(function (e) { return renderCard(e, { w: 224, h: 126 }); }).join("") + "</div></div>"; } else if (style === "2") { html = '<div class="tb-style-2">' + renderCard(entries[0], { lead: true, w: 640, h: 360, excerpt: true, excerptLen: 160 }) + '<div class="tb-subgrid">' + entries.slice(1).map(function (e) { return renderCard(e, { w: 400, h: 225 }); }).join("") + "</div></div>"; } else if (style === "3") { html = '<div class="tb-style-3">' + entries.map(function (e) { return renderCard(e, { w: 400, h: 225, excerpt: true, excerptLen: 95 }); }).join("") + "</div>"; } else if (style === "4") { html = '<div class="tb-style-4">' + entries.map(function (e) { return renderCard(e, { w: 400, h: 225, excerpt: true, excerptLen: 150 }); }).join("") + "</div>"; } else if (style === "5") { html = '<div class="tb-style-5">' + entries.map(function (e) { return renderCard(e, { w: 480, h: 360, overlay: true }); }).join("") + "</div>"; } else { html = '<div class="tb-style-6">' + renderCard(entries[0], { lead: true, w: 560, h: 315, excerpt: true, excerptLen: 110 }) + '<div class="tb-list-sm">' + entries.slice(1).map(function (e) { return renderCard(e, { w: 200, h: 112 }); }).join("") + "</div></div>"; } return html; } function fetchFeed(label, count) { var path = label && label !== "recent" ? "/feeds/posts/summary/-/" + encodeURIComponent(label) : "/feeds/posts/summary"; var url = path + "?alt=json&max-results=" + count; if (!feedCache[url]) { feedCache[url] = fetch(url) .then(function (res) { if (!res.ok) throw new Error("Feed error"); return res.json(); }) .then(function (data) { return (data.feed && data.feed.entry) || []; }) .catch(function () { return []; }); } return feedCache[url]; } function createBoxElement(cfg) { var style = String(cfg.style || "1"); var color = cfg.color || DEFAULT_COLORS[style] || "#db614c"; var box = document.createElement("section"); box.className = "tb-box"; box.style.setProperty("--tb-accent", color); box.innerHTML = buildHeader(cfg) + '<div class="tb-content"><div class="tb-skel-grid">' + '<div class="tb-skel-card"></div><div class="tb-skel-card"></div><div class="tb-skel-card"></div>' + "</div></div>"; box._tbLoad = function () { var count = Math.min(Math.max(parseInt(cfg.count, 10) || 5, 1), 20); fetchFeed(cfg.label || "", count).then(function (entries) { var target = box.querySelector(".tb-content"); if (target) target.innerHTML = renderEntries(entries, style); }); }; return box; } function mountShortcodes() { var SKIP = { SCRIPT: 1, STYLE: 1, CODE: 1, PRE: 1, TEXTAREA: 1, NOSCRIPT: 1 }; var regex = /\[(chuyenmuc-doi|chuyenmuc)\s+([^\]]+)\]/g; var walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null); var nodes = []; var node; while ((node = walker.nextNode())) { if (node.parentNode && !SKIP[node.parentNode.tagName] && regex.test(node.nodeValue)) { nodes.push(node); } regex.lastIndex = 0; } var boxesToObserve = []; nodes.forEach(function (textNode) { var text = textNode.nodeValue; var frag = document.createDocumentFragment(); var lastIndex = 0; var m; regex.lastIndex = 0; while ((m = regex.exec(text)) !== null) { if (m.index > lastIndex) { frag.appendChild(document.createTextNode(text.slice(lastIndex, m.index))); } var type = m[1]; var attrs = parseAttrs(m[2]); if (type === "chuyenmuc-doi") { var dual = document.createElement("div"); dual.className = "tb-dual"; var b1 = createBoxElement({ label: attrs.label1 || "", title: attrs.title1 || attrs.label1 || "Chuyên mục 1", color: attrs.color1 || "#316ac5", count: attrs.count || 4, style: "6", links: attrs.links1 || "" }); var b2 = createBoxElement({ label: attrs.label2 || "", title: attrs.title2 || attrs.label2 || "Chuyên mục 2", color: attrs.color2 || "#309d86", count: attrs.count || 4, style: "6", links: attrs.links2 || "" }); dual.appendChild(b1); dual.appendChild(b2); frag.appendChild(dual); boxesToObserve.push(b1, b2); } else { var box = createBoxElement(attrs); frag.appendChild(box); boxesToObserve.push(box); } lastIndex = regex.lastIndex; } if (lastIndex < text.length) { frag.appendChild(document.createTextNode(text.slice(lastIndex))); } textNode.parentNode.replaceChild(frag, textNode); }); if ("IntersectionObserver" in window) { var io = new IntersectionObserver(function (entries) { entries.forEach(function (item) { if (item.isIntersecting) { item.target._tbLoad(); io.unobserve(item.target); } }); }, { rootMargin: "250px 0px" }); boxesToObserve.forEach(function (el) { io.observe(el); }); } else { boxesToObserve.forEach(function (el) { el._tbLoad(); }); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", mountShortcodes); } else { mountShortcodes(); } })(); /*]]>*/ </script>

Bước 3: Sử dụng Shortcode để tạo 6 kiểu chuyên mục

  • Bạn vào Bố cục (Layout) → Thêm tiện ích → HTML/JavaScript (đặt ở vùng cột chính phía trên tiện ích Blog1), sau đó dán các dòng shortcode tương ứng bên dưới rồi lưu lại. Không cần mở lại code XML mỗi lần muốn thêm hay sắp xếp lại chuyên mục.

Kiểu 1: 1 bài nổi bật lớn + danh sách bài nhỏ bên phải (Đỏ)

[chuyenmuc label="Thủ Thuật Blogger" title="Blog" style="1" count="5" color="#db614c" links="Thiết Kế Web|/search/label/Thiet-Ke-Web, Photoshop|/search/label/Photoshop"]

Kiểu 2: 1 bài nổi bật ngang ở trên + lưới 3 cột bên dưới (Cam)

[chuyenmuc label="Nhạc" title="Nhạc & Phim" style="2" count="4" color="#f0a341" links="Phim|/search/label/Phim, Thời trang|/search/label/Thoi-Trang"]

Kiểu 3: Lưới thẻ bài viết 3 cột đồng đều (Xanh dương)

[chuyenmuc label="Công Nghệ" title="Công Nghệ" style="3" count="6" color="#316ac5"]

Kiểu 4: Danh sách tạp chí ngang có mô tả ngắn (Xanh ngọc)

[chuyenmuc label="Thủ Thuật" title="Thủ Thuật Mới" style="4" count="4" color="#309d86"]

Kiểu 5: Lưới ảnh Overlay Responsive

[chuyenmuc label="Thời Trang" title="Bộ Sưu Tập" style="5" count="6" color="#7c3aed"]

Kiểu 6: Hai chuyên mục song song trên cùng một hàng

[chuyenmuc-doi label1="Thủ Thuật Blogger" title1="Thủ Thuật Blogger" color1="#316ac5" label2="Giải Trí" title2="Blog Giải Trí" color2="#309d86" count="4"]

Bảng tham số Shortcode & Lưu ý quan trọng

  • label:Tên nhãn (phân biệt chữ hoa/thường theo đúng Label trong Blogger). Để trống hoặc điền "recent" để lấy toàn bộ bài viết mới nhất.
  • style: Chọn giao diện từ "1" đến "5" (mặc định "1"). Riêng kiểu 2 cột dùng [chuyenmuc-doi ...].
  • count: Số bài viết hiển thị, từ 1 đến 20 (mặc định 5).
  • title: Tiêu đề hiển thị trên thanh chuyên mục (nếu bỏ trống sẽ tự lấy theo label).
  • color: Mã màu Hex tùy biến cho từng chuyên mục (ví dụ #db614c, #2563eb).
  • links: Các liên kết phụ trên thanh tiêu đề.
  • Bật Feed Blog ở chế độ Tóm tắt hoặc Đầy đủ: Vào Cài đặt (Settings) → Nguồn cấp dữ liệu trang web → Cho phép nguồn cấp dữ liệu blog, đảm bảo đang chọn Đầy đủ (Full) hoặc Cho đến dấu ngắt chuyển trang (Until Jump Break) để đoạn mô tả ngắn và ảnh thumbnail hoạt động đầy đủ.
  • Chỉ hiển thị ở trang chủ: Nếu bạn dán shortcode vào tiện ích HTML/JavaScript trong phần Bố cục và chỉ muốn tiện ích này xuất hiện ở trang chủ, hãy vào Chủ đề → Chỉnh sửa HTML, tìm ID tiện ích HTML vừa tạo và thêm thuộc tính cond='data:view.isHomepage' vào thẻ <b:widget ...>.
  • Các bạn nhớ thay các tên nhãn cho phù hợp với blog của mình.
BLOGGER v3

Demo Chuyên Mục Theo Nhãn

Tạo & thử Shortcode trực tiếp

Tùy chỉnh thông số bên dưới để tạo mã dán vào Bố cục → HTML/JavaScript
[chuyenmuc label="Thủ Thuật Blogger" title="Thủ Thuật Blogger" style="1" count="5" color="#db614c"]
Khung xem: Desktop (100%)
DMCA.com Protection Status
Nhận xét (2)
Bóc temA Đê Min
A Đê Min
#1Bật "URL chuyển hướng nguồn cấp dữ liệu bài đăng" hay chặn feed mặc định vậy? Vẫn dùng được /feeds/posts/summary để update tại liên kết link 😁

Nhiều bài hay phải để cập nhật chứ "ngủ đông" không ổn đâu
Xóa
Trực Blog
Trực Blog
#2Haha, đã thoát trạng thái ngủ đông rồi bác. Vì em đã bỏ <b:include data='blog' name='all-head-content'/> để tối ưu tốc độ nhưng chưa khai báo lại hai thẻ <link rel='alternate'>, Blog List không tìm thấy địa chỉ nguồn cấp dữ liệu nào nên không thể kiểm tra ngày cập nhật 😂
Xóa
Bạn có câu hỏi hoặc góp ý cho bài viết này?
Soạn nhận xétChỉnh sửa nội dung trước khi đăng
0 ký tự Sao chép rồi dán vào khung Blogger bên dưới
Gửi nhận xétĐăng bằng tài khoản Blogger/Google của bạn