<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Kiến thức website &#8211; GenContent &#8211; Digital Marketing &#8211; Web Seo &#8211; Copywriting chuyên nghiệp</title>
	<atom:link href="https://gencontent.top/kien-thuc-website/feed/" rel="self" type="application/rss+xml" />
	<link>https://gencontent.top</link>
	<description>Giải pháp tăng hiện diện online cho doanh nghiệp nhỏ bằng nội dung AI tối ưu và hệ thống tự động hóa</description>
	<lastBuildDate>Sat, 29 Aug 2026 08:27:06 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>

<image>
	<url>https://gencontent.top/wp-content/uploads/2025/04/cropped-logo-gencontent-symbol-150x150-1-32x32.png</url>
	<title>Kiến thức website &#8211; GenContent &#8211; Digital Marketing &#8211; Web Seo &#8211; Copywriting chuyên nghiệp</title>
	<link>https://gencontent.top</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Hướng dẫn tạo Short code làm tiếp thị liên kết chuyên nghiệp</title>
		<link>https://gencontent.top/huong-dan-tao-short-code-lam-tiep-thi-lien-ket/</link>
					<comments>https://gencontent.top/huong-dan-tao-short-code-lam-tiep-thi-lien-ket/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 29 Aug 2026 08:19:50 +0000</pubDate>
				<category><![CDATA[Kiến thức website]]></category>
		<guid isPermaLink="false">https://gencontent.top/?p=1791</guid>

					<description><![CDATA[Shortcode giúp bạn tạo các khối sản phẩm tiếp thị liên kết trực quan, đồng bộ và dễ quản lý ngay trong nội dung website. Trong bài viết này, Gencontent sẽ hướng dẫn cách tạo shortcode làm tiếp thị liên kết chuyên nghiệp, từ cấu trúc cơ bản đến cách tùy biến giao diện và [...]]]></description>
										<content:encoded><![CDATA[<p>Shortcode giúp bạn tạo các khối sản phẩm tiếp thị liên kết trực quan, đồng bộ và dễ quản lý ngay trong nội dung website. Trong bài viết này, <a href="https://gencontent.top/"><strong>Gencontent</strong></a> sẽ <strong>hướng dẫn cách tạo shortcode làm tiếp thị liên kết </strong>chuyên nghiệp, từ cấu trúc cơ bản đến cách tùy biến giao diện và tối ưu khả năng chuyển đổi.</p>
<h2><strong>Các Plugin cần chuẩn bị để tạo Short code làm tiếp thị liên kết</strong></h2>
<p><strong>1. Advanced Custom Fields PRO: </strong>cái này dùng để cài đặt nhúng các trường dữ liệu cần thiết cho short code. Lưu ý là bản Pro mới dùng được, bản free thì không đủ tính năng.</p>
<p><strong>2. Custom Post Type UI:</strong> cái này để tạo danh mục sản phẩm riêng cho AFF. Cái này dùng bản free được.</p>
<h2><strong>Các bước thực hiện tạo Short code affiliate</strong></h2>
<h3><strong>Bước 1. Tạo Danh mục sản phẩm mới với Custom Post Type UI</strong></h3>
<p>Vào <strong>Custom Post Type UI</strong> -&gt; add/edit post type -&gt; điền &#8220;shopee_product&#8221; vào các trường dữ liệu như hình, rồi bấm <strong>add post type</strong>.</p>
<p>Sau khi tạo xong trên cột Menu Dashboard sẽ xuất hiện thêm dòng <strong>shopee product, </strong>nhưng lúc này vẫn chưa sử dụng được.</p>
<figure id="attachment_1793" aria-describedby="caption-attachment-1793" style="width: 800px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" class="wp-image-1793 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/tao-danh-muc-san-pham-aff-1.webp" alt="tạo danh mục sản phẩm aff" width="800" height="414" srcset="https://gencontent.top/wp-content/uploads/2026/08/tao-danh-muc-san-pham-aff-1.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/tao-danh-muc-san-pham-aff-1-300x155.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/tao-danh-muc-san-pham-aff-1-768x397.webp 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1793" class="wp-caption-text">Tạo danh mục sản phẩm aff</figcaption></figure>
<h3><strong>Bước 2. Thêm trường dữ liệu vào shopee product bằng Advanced Custom Fields PRO</strong></h3>
<p>&#8211; Vào AFC -&gt; Fields Group -&gt; And new Group, sau đó sẽ ra bàng để các bạn điền thông tin cho group</p>
<p><strong>&#8211; Điền tên trường:</strong> shopee product</p>
<figure id="attachment_1794" aria-describedby="caption-attachment-1794" style="width: 800px" class="wp-caption alignnone"><img decoding="async" class="wp-image-1794 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/Them-truong-du-lieu-vao-shopee-product.webp" alt="Thêm trường dữ liệu vào shopee product" width="800" height="300" srcset="https://gencontent.top/wp-content/uploads/2026/08/Them-truong-du-lieu-vao-shopee-product.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/Them-truong-du-lieu-vao-shopee-product-300x113.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/Them-truong-du-lieu-vao-shopee-product-768x288.webp 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1794" class="wp-caption-text">Thêm trường dữ liệu vào shopee product</figcaption></figure>
<p><strong>&#8211; Thêm Field 1:</strong> Product Image, Loại image</p>
<figure id="attachment_1795" aria-describedby="caption-attachment-1795" style="width: 800px" class="wp-caption alignnone"><img decoding="async" class="wp-image-1795 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/them-shopee-image.webp" alt="thêm shopee image" width="800" height="608" srcset="https://gencontent.top/wp-content/uploads/2026/08/them-shopee-image.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/them-shopee-image-300x228.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/them-shopee-image-768x584.webp 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1795" class="wp-caption-text">thêm shopee image</figcaption></figure>
<p>&#8211; <strong>Thêm Field 2</strong> là Affiliate Shops, Type đặt dạng <a href="https://vi.wikipedia.org/wiki/B%E1%BB%99_l%E1%BA%B7p" rel="nofollow noopener" target="_blank">Repeater</a>.</p>
<p>Ở dưới Sub Fileds thì thêm 3 trường dữ liệu:</p>
<ul>
<li>Shop Name: text</li>
<li>Affiliate Link: Url</li>
<li>Shop Price: text</li>
</ul>
<p>( Bạn muốn thêm trường gì thì có thể thay đổi và thêm ở đây )</p>
<figure id="attachment_1796" aria-describedby="caption-attachment-1796" style="width: 800px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="wp-image-1796 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/them-link-va-gia.webp" alt="thêm link và giá vào shopee product aff" width="800" height="468" srcset="https://gencontent.top/wp-content/uploads/2026/08/them-link-va-gia.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/them-link-va-gia-300x176.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/them-link-va-gia-768x449.webp 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1796" class="wp-caption-text">thêm link và giá vào shopee product aff</figcaption></figure>
<p>&#8211; Cài đặt output cho trường dữ liệu: Post type is equal to shopee product, để gắn các trường dữ liệu này vào danh mục sản phẩm đã tạo ở trên.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-1797 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/cai-dat-cau-hinh-truong-du-lieu.webp" alt="" width="800" height="191" srcset="https://gencontent.top/wp-content/uploads/2026/08/cai-dat-cau-hinh-truong-du-lieu.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/cai-dat-cau-hinh-truong-du-lieu-300x72.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/cai-dat-cau-hinh-truong-du-lieu-768x183.webp 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></p>
<h3><strong>Bước 3. Thêm sản phẩm vào Shopee product.</strong></h3>
<p>Lúc này các bạn vào shopee product trên Dashboard,</p>
<ul>
<li>Thêm sản phẩm, điền tên sản phẩm, URL sản phẩm có thể để mặc định theo tên hoặc tùy chỉnh</li>
<li>Thêm ảnh sản phẩm</li>
<li>Trong trường Affiliate Shop các bạn có thể thêm nhiều dòng, mỗi dòng sẽ đại diện cho 1 link AFF, lúc này bạn sẽ điền Shop name, link aff, giá sản phẩm.</li>
<li>Sau khi tạo sản phẩm xong bạn sẽ có 1 URL sản phẩm như: https://domain.com/shopee_product/slug-san-pham</li>
<li>Thì sử dụng cái slug-san-pham đó cho vào đoạn code này là thành shorcode: </span></li>
</ul>
<p>Sau khi có short code rồi bạn có thể thêm vào bất cứ bài blog nào phù hợp.</p>
<figure id="attachment_1798" aria-describedby="caption-attachment-1798" style="width: 800px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="wp-image-1798 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/them-link-san-pham-ten-va-gia-ca-vao-product.webp" alt="tạo Short code làm tiếp thị liên kết" width="800" height="373" srcset="https://gencontent.top/wp-content/uploads/2026/08/them-link-san-pham-ten-va-gia-ca-vao-product.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/them-link-san-pham-ten-va-gia-ca-vao-product-300x140.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/them-link-san-pham-ten-va-gia-ca-vao-product-768x358.webp 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1798" class="wp-caption-text">Tạo sản phẩm trong Short code làm tiếp thị liên kết</figcaption></figure>
<p>Ảnh minh họa sản phẩm aff được hiển thị trên website:</p>
<figure id="attachment_1799" aria-describedby="caption-attachment-1799" style="width: 800px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="wp-image-1799 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/Huong-da-tao-link-shopee-aff-tren-website.webp" alt="Hướng dẫ tạo link shopee aff trên website" width="800" height="425" srcset="https://gencontent.top/wp-content/uploads/2026/08/Huong-da-tao-link-shopee-aff-tren-website.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/Huong-da-tao-link-shopee-aff-tren-website-300x159.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/Huong-da-tao-link-shopee-aff-tren-website-768x408.webp 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1799" class="wp-caption-text">Hướng dẫn tạo link shopee aff trên website</figcaption></figure>
<h3><strong>Bước 4. Hiển thị Short code lên trên website</strong></h3>
<p>Sau khi đã tạo được sản phẩm shopee aff rồi, thì bạn cần tạo Short code và ném nó vào các bài blog trên website.</p>
<p><strong>1. Cài đặt code hiển thị trong file Function.php</strong>, truy cập Giao diện -&gt; Sửa tệp tin giao diện -&gt; rồi thêm đoạn code này vào, thêm xong thì nhớ lưu lại:</p>
<figure id="attachment_1800" aria-describedby="caption-attachment-1800" style="width: 279px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="wp-image-1800 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/sua-file-functions.php_.jpg" alt="sửa file functions.php" width="279" height="375" srcset="https://gencontent.top/wp-content/uploads/2026/08/sua-file-functions.php_.jpg 279w, https://gencontent.top/wp-content/uploads/2026/08/sua-file-functions.php_-223x300.jpg 223w" sizes="auto, (max-width: 279px) 100vw, 279px" /><figcaption id="caption-attachment-1800" class="wp-caption-text">sửa file functions.php</figcaption></figure>
<p>Đây là đoạn code đã được mình tinh chỉnh, thêm lượt đánh giá 5* ảo để trông cho đẹp mắt:</p>
<blockquote>
<div>// Tạo shortcode aff shopee //</div>
<div>function aff_product_shortcode($atts){</div>
<div></div>
<div>    $atts = shortcode_atts([</div>
<div>        &#8216;slug&#8217; =&gt; &#8221;</div>
<div>    ], $atts);</div>
<div></div>
<div>    $product = get_page_by_path(</div>
<div>        $atts[&#8216;slug&#8217;],</div>
<div>        OBJECT,</div>
<div>        &#8216;shopee_product&#8217;</div>
<div>    );</div>
<div></div>
<div>    if(!$product){</div>
<div>        return &#8221;;</div>
<div>    }</div>
<div></div>
<div>    $id = $product-&gt;ID;</div>
<div></div>
<div>    $title = get_the_title($id);</div>
<div></div>
<div>    $reviews = 99 + ($id % 800);</div>
<div></div>
<div>    $image = get_field(&#8216;product_image&#8217;, $id);</div>
<div></div>
<div>    if(is_array($image)){</div>
<div>        $image_url = $image[&#8216;url&#8217;] ?? &#8221;;</div>
<div>    }elseif(is_numeric($image)){</div>
<div>        $image_url = wp_get_attachment_url($image);</div>
<div>    }else{</div>
<div>        $image_url = $image;</div>
<div>    }</div>
<div></div>
<div>    ob_start();</div>
<div>    ?&gt;</div>
<div></div>
<div>    &lt;div class=&#8221;aff-product-box&#8221;&gt;</div>
<div></div>
<div>        &lt;div class=&#8221;aff-product-image&#8221;&gt;</div>
<div>            &lt;?php if($image_url): ?&gt;</div>
<div>                &lt;img src=&#8221;&lt;?php echo esc_url($image_url); ?&gt;&#8221; alt=&#8221;&lt;?php echo esc_attr($title); ?&gt;&#8221;&gt;</div>
<div>            &lt;?php endif; ?&gt;</div>
<div>        &lt;/div&gt;</div>
<div></div>
<div>        &lt;div class=&#8221;aff-product-info&#8221;&gt;</div>
<div></div>
<div>            &lt;h3 class=&#8221;aff-product-title&#8221;&gt;</div>
<div>                &lt;?php echo esc_html($title); ?&gt;</div>
<div>            &lt;/h3&gt;</div>
<div></div>
<div>            &lt;div class=&#8221;aff-product-rating&#8221;&gt;</div>
<div>                ★★★★★</div>
<div>                &lt;span&gt;(&lt;?php echo $reviews; ?&gt; đánh giá)&lt;/span&gt;</div>
<div>            &lt;/div&gt;</div>
<div></div>
<div>            &lt;?php if(have_rows(&#8216;affiliate_shops&#8217;,$id)): ?&gt;</div>
<div></div>
<div>                &lt;?php while(have_rows(&#8216;affiliate_shops&#8217;,$id)): the_row();</div>
<div></div>
<div>                    $shop_name  = get_sub_field(&#8216;shop_name&#8217;);</div>
<div>                    $shop_price = get_sub_field(&#8216;shop_price&#8217;);</div>
<div>$shop_price = preg_replace(&#8216;/[^0-9]/&#8217;, &#8221;, $shop_price);</div>
<div>                    $shop_link  = get_sub_field(&#8216;affiliate_link&#8217;);</div>
<div>                ?&gt;</div>
<div></div>
<div>                    &lt;div class=&#8221;aff-shop-row&#8221;&gt;</div>
<div></div>
<div>                        &lt;span class=&#8221;aff-shop-price&#8221;&gt;</div>
<div>                            &lt;?php echo number_format((int)$shop_price, 0, &#8216;,&#8217;, &#8216;.&#8217;); ?&gt;₫</div>
<div>                        &lt;/span&gt;</div>
<div></div>
<div>                        &lt;a href=&#8221;&lt;?php echo esc_url($shop_link); ?&gt;&#8221;</div>
<div>                           target=&#8221;_blank&#8221;</div>
<div>                           rel=&#8221;nofollow sponsored&#8221;</div>
<div>                           class=&#8221;aff-product-button&#8221;&gt;</div>
<div></div>
<div>                            Mua tại &lt;?php echo esc_html($shop_name); ?&gt;</div>
<div></div>
<div>                        &lt;/a&gt;</div>
<div></div>
<div>                    &lt;/div&gt;</div>
<div></div>
<div>                &lt;?php endwhile; ?&gt;</div>
<div></div>
<div>            &lt;?php endif; ?&gt;</div>
<div></div>
<div>        &lt;/div&gt;</div>
<div></div>
<div>    &lt;/div&gt;</div>
<div></div>
<div>    &lt;?php</div>
<div></div>
<div>    return ob_get_clean();</div>
<div>}</div>
<div></div>
<div>add_shortcode(&#8216;aff&#8217;,&#8217;aff_product_shortcode&#8217;);</div>
</blockquote>
<p><strong>2. Cài đặt hiển thị trong Custome CSS:</strong></p>
<p>Lúc này Short code đã hoạt động, nhưng nó vẫn khá xấu, vì thế cần cài đặt CSS để nó hiển thị đẹp mắt hơn. Kích thước, bố cục website của mình có thể khác các bạn, nên việc méo hình có thể xảy ra, lúc này hãy chỉnh sửa lại các thông số trong css để hiển thị phù hợp hơn.</p>
<p>Bạn vào Giao diện -&gt; Tùy chỉnh -&gt; Css bổ xung rồi thêm đoạn code này vào:</p>
<blockquote><p>/* cài đặt aff link shopee */<br />
.aff-product-box{<br />
display:flex;<br />
gap:20px;<br />
padding:15px;<br />
border:1px solid #e5e5e5;<br />
border-radius:8px;<br />
margin:20px 0;<br />
align-items:flex-start;<br />
}</p>
<p>.aff-product-image{<br />
width:300px;<br />
flex-shrink:0;<br />
}</p>
<p>.aff-product-image img{<br />
width:300px;<br />
height:300px;<br />
object-fit:contain;<br />
display:block;<br />
}</p>
<p>.aff-product-info{<br />
flex:1;<br />
}</p>
<p>.aff-product-title{<br />
margin:0 0 10px;<br />
font-size:24px;<br />
font-weight:700;<br />
line-height:1.4;<br />
}</p>
<p>.aff-product-rating{<br />
color:#f5a623;<br />
font-size:16px;<br />
margin-bottom:20px;<br />
}</p>
<p>.aff-product-rating span{<br />
color:#666;<br />
margin-left:5px;<br />
}</p>
<p>.aff-shop-row{<br />
display:flex;<br />
align-items:center;<br />
gap:15px;<br />
margin-bottom:12px;<br />
}</p>
<p>.aff-shop-price{<br />
width:140px;<br />
color:#e53935;<br />
font-size:22px;<br />
font-weight:700;<br />
}</p>
<p>.aff-product-button{<br />
display:inline-block;<br />
background:#ee4d2d;<br />
color:#fff !important;<br />
padding:8px 15px;<br />
border-radius:5px;<br />
text-decoration:none;<br />
font-weight:600;<br />
}</p>
<p>.aff-product-button:hover{<br />
opacity:.9;<br />
}</p></blockquote>
<p>3. Thêm Short code vào bài viết hay vị trí cần hiển thị:</p>
<p>Trong quá trình soạn thảo blog, bạn có thể thêm Short code vào bất cứ vị trí nào trong bài viết, ở đầu, giữa, cuối đều được.</p>
<p>Sau đó save bài viết lại và truy cập link bài blog trực tiếp để thấy sản phẩm shopee aff đã được hiển thị.</p>
<p>Ví dụ mình viết bài về các bài tập tay, tập ngực, mình gắn liên kết tới các loại tạ tay, bạn có thể tham khảo hiển thị shop tạ tay trong bài viết này: <a href="https://suckhoeplus.net/bai-tap-nguc/" rel="nofollow noopener" target="_blank">https://suckhoeplus.net/bai-tap-nguc/</a></p>
<figure id="attachment_1801" aria-describedby="caption-attachment-1801" style="width: 800px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="wp-image-1801 size-full" src="https://gencontent.top/wp-content/uploads/2026/08/them-short-code-vao-bai-viet.webp" alt="thêm short code vào bài viết" width="800" height="470" srcset="https://gencontent.top/wp-content/uploads/2026/08/them-short-code-vao-bai-viet.webp 800w, https://gencontent.top/wp-content/uploads/2026/08/them-short-code-vao-bai-viet-300x176.webp 300w, https://gencontent.top/wp-content/uploads/2026/08/them-short-code-vao-bai-viet-768x451.webp 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-1801" class="wp-caption-text">thêm short code vào bài viết</figcaption></figure>
<p><strong>Tạo shortcode làm tiếp thị liên kết</strong> giúp website trình bày sản phẩm trực quan, dễ quản lý và có thể tái sử dụng ở nhiều vị trí khác nhau. Khi kết hợp shortcode với nội dung hữu ích, nút kêu gọi hành động và cách đặt liên kết hợp lý, bạn có thể xây dựng hệ thống affiliate chuyên nghiệp hơn và tối ưu khả năng chuyển đổi. Bạn cũng có thể xem thêm <a href="https://gencontent.top/kien-thuc-website/"><strong data-start="321" data-end="409">các kiến thức về website, WordPress </strong></a>và tối ưu nội dung để hoàn thiện website và nâng cao hiệu quả tiếp thị liên kết.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gencontent.top/huong-dan-tao-short-code-lam-tiep-thi-lien-ket/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
