{"id":1041,"date":"2025-02-07T22:39:22","date_gmt":"2025-02-07T15:39:22","guid":{"rendered":"https:\/\/cuongnguyen.io.vn\/?p=1041"},"modified":"2025-02-07T22:39:22","modified_gmt":"2025-02-07T15:39:22","slug":"huong-dan-advanced-custom-field-acf","status":"publish","type":"post","link":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/2025\/02\/07\/huong-dan-advanced-custom-field-acf\/","title":{"rendered":"H\u01af\u1edaNG D\u1eaaN ADVANCED CUSTOM FIELD (ACF)"},"content":{"rendered":"<p>M\u1eb7c d\u00f9 m\u00ecnh h\u01b0\u1edbng d\u1eabn \u1edf \u0111\u00e2y nh\u01b0ng ch\u1eafc ch\u1eafn s\u1ebd kh\u00f4ng \u0111\u1ea7y \u0111\u1ee7 v\u00ec m\u00ecnh ch\u1ec9 \u0111i v\u00e0o ph\u1ea7n tr\u1ecdng t\u00e2m, do \u0111\u00f3 h\u00e3y \u0111\u1ecdc th\u00eam\u00a0<a title=\"ACF Documentation\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/\">ACF Documentation<\/a>\u00a0\u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 plugin n\u00e0y nh\u00e9.<\/p>\n<h4 class=\"ftwp-heading\">L\u00e0m quen v\u1edbi ACF<\/h4>\n<p><a title=\"ACF plugin\" href=\"http:\/\/wordpress.org\/plugins\/advanced-custom-fields\/\">Link t\u1ea3i plugin<\/a><\/p>\n<p>Sau khi c\u00e0i \u0111\u1eb7t xong b\u1ea1n v\u00e0o\u00a0<strong>Dashboard &gt;&gt; Custom Fields &gt;&gt; Custom Fields<\/strong>\u00a0\u0111\u1ec3 t\u1ea1o field v\u00e0 qu\u1ea3n l\u00fd c\u00e1c field \u0111\u00e3 t\u1ea1o. \u1ede \u0111\u00e2y b\u1ea1n s\u1ebd t\u1ea1o field theo t\u1eebng nh\u00f3m (group) b\u1edfi v\u00ec n\u00f3 s\u1ebd hi\u1ec3n th\u1ecb theo nh\u00f3m trong khu v\u1ef1c vi\u1ebft b\u00e0i.<\/p>\n<p>\u1ea4n n\u00fat\u00a0<strong>Add New<\/strong>\u00a0\u0111\u1ec3 b\u1eaft \u0111\u1ea7u t\u1ea1o field.<\/p>\n<p>\u1ede trong trang t\u1ea1o field b\u1ea1n s\u1ebd c\u00f3 t\u1ea5t c\u1ea3 l\u00e0 4 khu v\u1ef1c ch\u00ednh bao g\u1ed3m:<\/p>\n<div class=\"wp-caption aligncenter\"><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-Ynua.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-16037\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 34\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-Ynua.jpg\" alt=\"Khu v\u1ef1c t\u1ea1o field c\u1ee7a ACF\" width=\"700\" height=\"474\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Khu v\u1ef1c t\u1ea1o field c\u1ee7a ACF<\/p>\n<\/div>\n<ul>\n<li>T\u00ean nh\u00f3m (Enter title here).<\/li>\n<li>Danh s\u00e1ch c\u00e1c field.<\/li>\n<li>Location, \u1edf \u0111\u00e2y c\u00f3 m\u1ed9t t\u00f9y ch\u1ecdn Rules \u0111\u1ec3 b\u1ea1n thi\u1ebft l\u1eadp c\u00e1c \u0111i\u1ec1u ki\u1ec7n. Ki\u1ec3u nh\u01b0 b\u1ea1n s\u1ebd thi\u1ebft l\u1eadp n\u00f3 s\u1ebd hi\u1ec3n th\u1ecb v\u00e0 l\u00e0m vi\u1ec7c n\u1ebfu n\u00f3 th\u1ecfa m\u00e3n \u0111i\u1ec1u ki\u1ec7n n\u00e0o \u0111\u00f3.<\/li>\n<li>Options \u2013 bao g\u1ed3m c\u00e1c t\u00f9y ch\u1ecdn n\u00e2ng cao, m\u00ecnh s\u1ebd gi\u1ea3i th\u00edch r\u00f5 h\u01a1n sau.<\/li>\n<\/ul>\n<h4 class=\"ftwp-heading\">C\u00e1ch t\u1ea1o m\u1ed9t nh\u00f3m field<\/h4>\n<p>Khi v\u00e0o ph\u1ea7n t\u1ea1o field, b\u1ea1n s\u1ebd c\u1ea7n \u0111i\u1ec1n t\u00ean nh\u00f3m field tr\u01b0\u1edbc, \u0111\u00e2y ch\u1ec9 l\u00e0 t\u00ean nh\u00f3m \u0111\u1ec3 b\u1ea1n d\u1ec5 d\u00e0ng qu\u1ea3n l\u00fd sau n\u00e0y ch\u1ee9 kh\u00f4ng ph\u1ea3i l\u00e0 t\u00ean field nh\u00e9, b\u1ea1n c\u00f3 th\u1ec3 \u0111\u1eb7t sao c\u0169ng \u0111\u01b0\u1ee3c. V\u00ed d\u1ee5:\u00a0<em>Field ph\u1ea7n m\u1ec1m<\/em><\/p>\n<p>\u1ede d\u01b0\u1edbi ph\u1ea7n danh s\u00e1ch field, b\u1ea1n \u1ea5n v\u00e0o n\u00fat\u00a0<strong>Add Field<\/strong>\u00a0\u0111\u1ec3 b\u1eaft \u0111\u1ea7u th\u00eam m\u1ed9t field v\u00e0o nh\u00f3m.<\/p>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-1CYe.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-16038\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 35\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-1CYe.jpg\" alt=\"acf-addfield\" width=\"525\" height=\"177\" \/><\/a><\/p>\n<p>M\u1ed9t c\u1eeda s\u1ed5 nh\u1ecf \u0111\u1ed9t ng\u1ed9t s\u1ed5 ra, n\u00f3 s\u1ebd c\u00f3 c\u00e1c t\u00f9y ch\u1ecdn sau:<\/p>\n<ul>\n<li><strong>Field Label<\/strong>: T\u00ean field hi\u1ec3n th\u1ecb trong ph\u1ea7n nh\u1eadp li\u1ec7u.<\/li>\n<li><strong>Field Name<\/strong>: T\u00ean c\u1ee7a field, \u0111\u1ec3 b\u1ea1n g\u1ecdi ra ngo\u00e0i, kh\u00f4ng ch\u1ee9a k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t v\u00e0 kho\u1ea3ng tr\u1eafng. Th\u01b0\u1eddng n\u00f3 s\u1ebd t\u1ef1 x\u00e1c \u0111\u1ecbnh d\u1ef1a v\u00e0o Field Label.<\/li>\n<li><strong>Field Type<\/strong>: Lo\u1ea1i field, hay c\u00f2n g\u1ecdi l\u00e0 Ki\u1ec3u nh\u1eadp li\u1ec7u. B\u1ea1n xem danh s\u00e1ch gi\u1ea3i ngh\u0129a c\u00e1c field type m\u00ecnh ghi ph\u00eda d\u01b0\u1edbi \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n.<\/li>\n<li><strong>Field Introductions<\/strong>: Gi\u1edbi thi\u1ec7u v\u1ec1 field, n\u00f3 s\u1ebd hi\u1ec3n th\u1ecb ngay b\u00ean d\u01b0\u1edbi khung nh\u1eadp li\u1ec7u khi vi\u1ebft b\u00e0i.<\/li>\n<li><strong>Required<\/strong>: C\u00f3 b\u1eaft bu\u1ed9c ph\u1ea3i nh\u1eadp li\u1ec7u cho field n\u00e0y khi vi\u1ebft b\u00e0i hay kh\u00f4ng. Yes or Lo, nh\u1ea7m, No.<\/li>\n<li><strong>Default Value<\/strong>: Gi\u00e1 tr\u1ecb m\u1eb7c \u0111\u1ecbnh s\u1ebd \u00e1p d\u1ee5ng n\u1ebfu ng\u01b0\u1eddi d\u00f9ng kh\u00f4ng nh\u1eadp li\u1ec7u cho field.<\/li>\n<li><strong>Placeholder Text<\/strong>: Ch\u1eef s\u1ebd hi\u1ec3n th\u1ecb ngay b\u00ean trong khung nh\u1eadp li\u1ec7u nh\u01b0ng n\u00f3 s\u1ebd m\u1edd \u0111i v\u00e0 m\u1ea5t khi g\u00f5 gi\u00e1 tr\u1ecb v\u00e0o.<\/li>\n<li><strong>Prepend<\/strong>: Ch\u1eef s\u1ebd hi\u1ec3n th\u1ecb ngay tr\u01b0\u1edbc khung nh\u1eadp field (<a href=\"http:\/\/www.advancedcustomfields.com\/wp-content\/uploads\/2013\/07\/acf-input-prepend.jpg\">xem \u1ea3nh<\/a>).<\/li>\n<li><strong>Append<\/strong>: Gi\u1ed1ng prepend nh\u01b0ng n\u00f3 n\u1eb1m \u1edf ph\u00eda sau.<\/li>\n<li><strong>Formatting<\/strong>: C\u00f3 cho ph\u00e9p th\u1ef1c thi HTML t\u1eeb gi\u00e1 tr\u1ecb hay kh\u00f4ng. \u0110\u1ec3 nguy\u00ean l\u00e0 \u0111\u1eb9p.<\/li>\n<li><strong>Character Limit<\/strong>: Gi\u1edbi h\u1ea1n k\u00fd t\u1ef1 c\u1ee7a gi\u00e1 tr\u1ecb nh\u1eadp v\u00e0o.<\/li>\n<li><strong>Conditional Logic<\/strong>: Th\u00eam c\u00e1c \u0111i\u1ec1u ki\u1ec7n d\u1ef1a v\u00e0o c\u00e1c field kh\u00e1c. V\u00ed d\u1ee5 nh\u01b0 field A c\u00f3 gi\u00e1 tr\u1ecb l\u00e0 abc th\u00ec s\u1ebd hi\u1ec3n th\u1ecb field hi\u1ec7n t\u1ea1i.<\/li>\n<\/ul>\n<p>Nh\u1eadp xong b\u1ea1n c\u00f3 th\u1ec3 ti\u1ebfp t\u1ee5c \u1ea5n n\u00fat Add Field \u0111\u1ec3 th\u00eam c\u00e1c field kh\u00e1c.<\/p>\n<p>Ph\u1ea7n\u00a0<strong>Location<\/strong>\u00a0c\u0169ng kh\u00e1 \u0111\u01a1n gi\u1ea3n, b\u1ea1n c\u00f3 th\u1ec3 xem qua c\u00e1c t\u00f9y ch\u1ecdn \u1edf \u0111\u00f3 \u0111\u1ec3 thi\u1ebft l\u1eadp ph\u00f9 h\u1ee3p. N\u1ebfu b\u1ea1n t\u1ea1o custom field cho Post, ch\u1ec9 c\u1ea7n \u0111\u1ec3 m\u1eb7c \u0111\u1ecbnh.<\/p>\n<p>Ph\u1ea7n\u00a0<strong>Options<\/strong>\u00a0s\u1ebd c\u00f3 c\u00e1c tham s\u1ed1 nh\u01b0 sau:<\/p>\n<ul>\n<li><strong>Position<\/strong>: V\u1ecb tr\u00ed c\u1ee7a nh\u00f3m field n\u00e0y.<\/li>\n<li><strong>Order No<\/strong>: Th\u1ee9 t\u1ef1 hi\u1ec3n th\u1ecb trong khu v\u1ef1c vi\u1ebft b\u00e0i.<\/li>\n<li><strong>Style<\/strong>: B\u1ea1n n\u00ean ch\u1ecdn ki\u1ec3u Standard.<\/li>\n<li><strong>Hide on Screen<\/strong>: C\u00e1i n\u00e0y kh\u00f4ng c\u1ea7n thi\u1ebft, ch\u1ec9 c\u1ea7n \u0111\u1ec3 nguy\u00ean.<\/li>\n<\/ul>\n<p>Sau khi ch\u1ecdn xong, h\u00e3y \u1ea5n n\u00fat Publish \u0111\u1ec3 ho\u00e0n t\u1ea5t kh\u00e2u t\u1ea1o field. Sau \u0111\u00f3 v\u00e0o trang vi\u1ebft b\u00e0i b\u1ea1n s\u1ebd th\u1ea5y field, h\u00ecnh d\u01b0\u1edbi l\u00e0 v\u00ed d\u1ee5 c\u1ee7a m\u1ed9t nh\u00f3m field m\u00ecnh l\u00e0m m\u1eabu (c\u00f3 s\u1eed d\u1ee5ng Placeholder v\u00e0 Append).<\/p>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-57Fl.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-16039\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 36\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-57Fl.jpg\" alt=\"acf-fieldexample\" width=\"700\" height=\"307\" \/><\/a><\/p>\n<h4 class=\"ftwp-heading\">G\u1ecdi field ra ngo\u00e0i theme<\/h4>\n<p>Tr\u01b0\u1edbc khi g\u1ecdi field, b\u1ea1n n\u00ean xem qua b\u00e0i\u00a0<a title=\"C\u1ea5u tr\u00fac v\u00e0 \u00fd ngh\u0129a c\u00e1c file trong theme WordPress\" href=\"https:\/\/thachpham.com\/wordpress\/wordpress-development\/hieu-cau-truc-theme-wordpress.html\">c\u1ea5u tr\u00fac theme<\/a>\u00a0\u0111\u1ec3 hi\u1ec3u b\u1ea1n s\u1ebd ch\u00e8n v\u00e0o file n\u00e0o trong theme \u0111\u1ec3 hi\u1ec3n th\u1ecb \u0111\u00fang \u00fd m\u00ecnh n\u1ebfu b\u1ea1n ch\u01b0a hi\u1ec3u c\u1ea5u tr\u00fac theme.<\/p>\n<p>Trong ACF, \u0111\u1ec3 g\u1ecdi gi\u00e1 tr\u1ecb c\u1ee7a field ra ta ch\u1ec9 s\u1eed d\u1ee5ng m\u1ed9t h\u00e0m duy nh\u1ea5t \u0111\u00f3 l\u00e0\u00a0<code>the_field()<\/code>\u00a0ho\u1eb7c\u00a0<code>get_field()<\/code>\u00a0(ph\u1ea3i d\u00f9ng th\u00eam echo n\u1ebfu mu\u1ed1n hi\u1ec3n th\u1ecb) ho\u1eb7c c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng h\u00e0m\u00a0<code>get_post_meta()<\/code>\u00a0nh\u01b0 custom field th\u00f4ng th\u01b0\u1eddng.<\/p>\n<p>C\u1ea5u tr\u00fac c\u1ee7a h\u00e0m\u00a0<code>the_field()<\/code>\u00a0l\u00e0:<\/p>\n<pre class=\"inline-code\">&lt;?php the_field(\u2018t\u00ean-field\u2019, \u2018ID-b\u00e0i-vi\u1ebft\u2019); ?&gt;<\/pre>\n<p>V\u00ed d\u1ee5:<\/p>\n<pre class=\"inline-code\">&lt;?php the_field(\u2018link_download\u2019); ?&gt;<\/pre>\n<p>Trong \u0111\u00f3, ID b\u00e0i vi\u1ebft l\u00e0 tham s\u1ed1 kh\u00f4ng b\u1eaft bu\u1ed9c, b\u1ea1n ch\u1ec9 nh\u1eadp n\u1ebfu c\u1ea7n l\u1ea5y gi\u00e1 tr\u1ecb custom field trong m\u1ed9t b\u00e0i n\u00e0o \u0111\u00f3 m\u00e0 th\u00f4i.<\/p>\n<p>V\u00ed d\u1ee5:<\/p>\n<pre class=\"inline-code\">&lt;?php the_field(\u2018link_download\u2019, \u201969\u2019); ?&gt;<\/pre>\n<p>Ho\u1eb7c b\u1ea1n s\u1eed d\u1ee5ng h\u00e0m\u00a0<code>get_field()<\/code>\u00a0v\u1edbi c\u00e1ch nh\u01b0 sau:<\/p>\n<p>&lt;?php<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>$field1 = get_field(\u2018link_download\u2019);<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>echo $field1;<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>if ($field1) {<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>echo &#8220;C\u00f3 gi\u00e1 tr\u1ecb&#8221;;<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>} else {<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>echo &#8220;Kh\u00f4ng c\u00f3 gi\u00e1 tr\u1ecb&#8221;;<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>}<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>?&gt;<\/p>\n<pre class=\"inline-code\"><\/pre>\n<p>&nbsp;<\/p>\n<p>Xem th\u00eam:\u00a0<a title=\"Displaying values in your theme\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/getting-started\/displaying-custom-field-values-in-your-theme\/\">Display value in theme \u2013 ACF<\/a><\/p>\n<h4 class=\"ftwp-heading\">Hi\u1ec3n th\u1ecb field b\u1eb1ng shortcode<\/h4>\n<p>N\u1ebfu b\u1ea1n kh\u00f4ng r\u00e0nh code PHP th\u00ec c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng shortcode \u0111\u1ec3 hi\u1ec3n th\u1ecb gi\u00e1 tr\u1ecb c\u1ee7a field b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng shortcode\u00a0<code>[acf field=\"field_name\" post_id=\"123\"]<\/code>. Trong \u0111\u00f3, tham s\u1ed1 post_id l\u00e0 kh\u00f4ng b\u1eaft bu\u1ed9c.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/functions\/shortcode\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">C\u00e1ch export field ra code<\/h4>\n<p>Ch\u1ee9c n\u0103ng Export b\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng th\u1ea5y \u1edf menu\u00a0<strong>Custom Fields &gt;&gt; Export<\/strong>.<\/p>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-mjaP.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-24390\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 37\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-mjaP.jpg\" alt=\"acf-export\" width=\"150\" height=\"162\" \/><\/a><\/p>\n<p>T\u1ea1i \u0111\u00e2y b\u1ea1n c\u00f3 th\u1ec3 ch\u1ecdn group c\u1ea7n export.<\/p>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-b4R2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24391 aligncenter\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 38\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-b4R2.jpg\" alt=\"acf-export02\" width=\"593\" height=\"258\" \/><\/a><\/p>\n<p>B\u00e2y gi\u1edd b\u1ea1n s\u1ebd \u0111\u01b0\u1ee3c m\u1ed9t \u0111o\u1ea1n code nh\u01b0 th\u1ebf n\u00e0y.<\/p>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-ISJD.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-24392\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 39\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-ISJD.jpg\" alt=\"acf-export03\" width=\"497\" height=\"588\" \/><\/a><\/p>\n<p>B\u1ea1n h\u00e3y copy \u0111o\u1ea1n m\u00e3 \u0111\u00f3, b\u1ecf v\u00e0o d\u1ef1 \u00e1n c\u1ee7a b\u1ea1n.<\/p>\n<p>Vi\u1ec7c c\u1ee7a b\u1ea1n b\u00e2y gi\u1edd l\u00e0\u00a0<strong>t\u1eaft plugin ACF<\/strong>\u00a0\u0111i. Sau \u0111\u00f3 di chuy\u1ec3n th\u01b0 m\u1ee5c\u00a0<em>advanced-custom-fields<\/em>\u00a0trong th\u01b0 m\u1ee5c\u00a0<em>plugins<\/em>\u00a0v\u00e0o th\u01b0 m\u1ee5c d\u1ef1 \u00e1n c\u1ee7a b\u1ea1n. R\u1ed3i nh\u00fang m\u00e3 ngu\u1ed3n ACF v\u00e0o d\u1ef1 \u00e1n c\u1ee7a b\u1ea1n v\u1edbi \u0111o\u1ea1n n\u00e0y.<\/p>\n<pre class=\"inline-code\">include_once(\u2018advanced-custom-fields\/acf.php\u2019);<\/pre>\n<p>V\u00e0 ch\u00e8n th\u00eam \u0111o\u1ea1n n\u00e0y \u0111\u1ec3 \u1ea5n menu Custom Fields n\u1ebfu kh\u00f4ng mu\u1ed1n hi\u1ec3n th\u1ecb.<\/p>\n<pre class=\"inline-code\">define( \u2018ACF_LITE\u2019, true );<\/pre>\n<h3 class=\"ftwp-heading\">Danh s\u00e1ch c\u00e1c ki\u1ec3u field c\u00f3 s\u1eb5n c\u1ee7a ACF<\/h3>\n<h4 class=\"ftwp-heading\">Repeater [<a href=\"http:\/\/www.advancedcustomfields.com\/pro\">Tr\u1ea3 ph\u00ed<\/a>]<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-k9Lv.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16042\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 40\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-k9Lv.jpg\" alt=\"acf-repeater-field-input\" width=\"964\" height=\"720\" \/><\/a>\u0110\u00e2y l\u00e0 ki\u1ec3u field kh\u00e1 \u0111\u1ed9c \u0111\u00e1o, n\u00f3 s\u1ebd t\u1ea1o ra m\u1ed9t khung d\u1eef li\u1ec7u m\u00e0 b\u1ea1n c\u00f3 th\u1ec3 th\u00eam bao nhi\u00eau gi\u00e1 tr\u1ecb t\u00f9y th\u00edch, t\u1ee9c l\u00e0 n\u00f3 h\u1ed7 tr\u1ee3 nhi\u1ec1u gi\u00e1 tr\u1ecb kh\u00e1c nhau.<\/p>\n<p>Do field n\u00e0y h\u1ed7 tr\u1ee3 gi\u00e1 nhi\u1ec1u gi\u00e1 tr\u1ecb n\u00ean b\u1ea1n kh\u00f4ng th\u1ec3 d\u00f9ng h\u00e0m get_field() \u0111\u1ec3 hi\u1ec3n th\u1ecb n\u00f3 m\u00e0 b\u1ea1n s\u1ebd ph\u1ea3i d\u00f9ng loop trong PHP,\u00a0<a title=\"Repeater field usage\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/repeater\/\">xem h\u01b0\u1edbng d\u1eabn<\/a>.<\/p>\n<h4 class=\"ftwp-heading\">Image<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-cAI3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16043\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 41\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-cAI3.jpg\" alt=\"acf-image-field-interface\" width=\"778\" height=\"700\" \/><\/a><\/p>\n<p>Ki\u1ec3u field n\u00e0y s\u1ebd cho ph\u00e9p b\u1ea1n upload \u1ea3nh l\u00ean m\u00e1y ch\u1ee7.<\/p>\n<p><a title=\"Image field\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/image\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a>.<\/p>\n<h4 class=\"ftwp-heading\">Gallery<\/h4>\n<p>&nbsp;<\/p>\n<p>T\u01b0\u01a1ng t\u1ef1 nh\u01b0 ki\u1ec3u Image nh\u01b0ng n\u00f3 s\u1ebd h\u1ed7 tr\u1ee3 hi\u1ec3n th\u1ecb nhi\u1ec1u \u1ea3nh kh\u00e1c nhau. Gi\u1ed1ng nh\u01b0 Repeater field, b\u1ea1n ph\u1ea3i d\u00f9ng loop \u0111\u1ec3 hi\u1ec3n th\u1ecb.<\/p>\n<p><a title=\"Gallery field\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/gallery\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Relationship<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-QMvO.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16045\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 43\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-QMvO.jpg\" alt=\"relationship_input\" width=\"700\" height=\"257\" \/><\/a><\/p>\n<p>Ki\u1ec3u field n\u00e0y s\u1ebd gi\u00fap b\u1ea1n ch\u1ecdn c\u00e1c b\u00e0i vi\u1ebft theo \u00fd b\u1ea1n mu\u1ed1n t\u1eeb m\u1ed9t post type n\u00e0o \u0111\u00f3, ki\u1ec3u nh\u01b0 l\u00e0 b\u00e0i vi\u1ebft con ho\u1eb7c b\u00e0i li\u00ean quan. N\u00f3 gi\u1ed1ng v\u1edbi t\u00ednh n\u0103ng\u00a0<a title=\"H\u01b0\u1edbng d\u1eabn Post Relationship trong WordPress\" href=\"https:\/\/thachpham.com\/wordpress\/wordpress-development\/huong-dan-post-relationship.html\">Post2Post<\/a>\u00a0m\u00e0 m\u00ecnh \u0111\u00e3 gi\u1edbi thi\u1ec7u.<\/p>\n<p><a title=\"Relationship field\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/relationship\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Post Object<\/h4>\n<p>T\u00ednh n\u0103ng n\u00e0y \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 l\u1ea5y gi\u00e1 tr\u1ecb c\u1ee7a m\u1ed9t b\u00e0i vi\u1ebft n\u00e0o \u0111\u00f3 v\u00e0 hi\u1ec3n th\u1ecb trong b\u00e0i hi\u1ec7n t\u1ea1i. V\u00ed d\u1ee5 b\u1ea1n mu\u1ed1n hi\u1ec3n th\u1ecb ti\u00eau \u0111\u1ec1 v\u00e0 n\u1ed9i dung \u1edf b\u00e0i vi\u1ebft kh\u00e1c th\u00ec c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng lo\u1ea1i field n\u00e0y.<\/p>\n<p><a title=\"PostObject\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/post-object\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Flexible Content<\/h4>\n<p>T\u00ednh n\u0103ng n\u00e0y gi\u1ed1ng nh\u01b0 ch\u1ee9c n\u0103ng page builder v\u1eady, b\u1ea1n c\u00f3 th\u1ec3 t\u1ef1 t\u1ea1o m\u1ed9t layout trang vi\u1ebft b\u00e0i theo \u00fd c\u1ee7a m\u00ecnh, d\u0129 nhi\u00ean c\u00e1ch s\u1eed d\u1ee5ng c\u0169ng h\u01a1i kh\u00f3 h\u01a1n.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/flexible-content\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Date Picker<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-pvMH.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16046\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 44\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-pvMH.png\" alt=\"date-picker-input\" width=\"710\" height=\"293\" \/><\/a><\/p>\n<p>N\u1ebfu b\u1ea1n c\u1ea7n field nh\u1eadp ng\u00e0y th\u00e1ng th\u00ec n\u00ean d\u00f9ng type Date Picker cho chuy\u00ean nghi\u1ec7p v\u00ec n\u00f3 s\u1ebd h\u1ed7 tr\u1ee3 th\u00eam m\u1ed9t khung ch\u1ecdn ng\u00e0y th\u00e1ng n\u0103m b\u1eb1ng jQuery r\u1ea5t ti\u1ec7n l\u1ee3i.<\/p>\n<p><a title=\"Date Picker\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/date-picker\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Checkbox<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-gMWP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16049\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 45\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-gMWP.png\" alt=\"checkbox-input\" width=\"945\" height=\"117\" \/><\/a><\/p>\n<p>Field ch\u1ecdn c\u00e1c gi\u00e1 tr\u1ecb \u0111\u00e3 nh\u1eadp s\u1eb5n b\u1eb1ng checkbox.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/checkbox\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Text<\/h4>\n<p>\u0110\u01a1n gi\u1ea3n l\u00e0 m\u1ed9t lo\u1ea1i field nh\u1eadp ch\u1eef th\u00f4ng th\u01b0\u1eddng.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/text\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Select<\/h4>\n<p>Field ch\u1ecdn gi\u00e1 tr\u1ecb c\u00f3 s\u1eb5n b\u1eb1ng menu dropdown.<\/p>\n<p><a title=\"Select field\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/select\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">True\/False<\/h4>\n<p>Field n\u00e0y s\u1ebd hi\u1ec3n th\u1ecb m\u1ed9t \u00f4 vu\u00f4ng, n\u1ebfu b\u1ecf tr\u1ed1ng l\u00e0 gi\u00e1 tr\u1ecb TRUE, \u0111\u00e1nh d\u1ea5u v\u00e0o l\u00e0 gi\u00e1 tr\u1ecb TRUE.<\/p>\n<p><a title=\"True false\" href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/true-false\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">File<\/h4>\n<p>T\u01b0\u01a1ng t\u1ef1 nh\u01b0 field Image nh\u01b0ng s\u1eed d\u1ee5ng tr\u00ecnh upload g\u1ed1c c\u1ee7a WordPress.<\/p>\n<h4 class=\"ftwp-heading\">Wysiwyg Editor<\/h4>\n<p>Ch\u00e8n field ki\u1ec3u khung so\u1ea1n th\u1ea3o gi\u1ed1ng nh\u01b0 khi vi\u1ebft b\u00e0i.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/wysiwyg-editor\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Page Link<\/h4>\n<p>Field ch\u1ecdn trang tr\u1ecf \u0111\u1ebfn, d\u00f9ng \u0111\u1ec3 t\u1ea1o li\u00ean k\u1ebft tr\u1ecf \u0111\u1ebfn trang kh\u00e1c c\u00f9ng ho\u1eb7c kh\u00e1c post type.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/page-link\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Color Picker<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-baYD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16050\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 46\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-baYD.png\" alt=\"color-picker-input-720x183\" width=\"720\" height=\"183\" \/><\/a><\/p>\n<p>Field ch\u1ecdn m\u00e3 m\u00e0u chuy\u00ean nghi\u1ec7p.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/color-picker\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h4 class=\"ftwp-heading\">Google Map<\/h4>\n<p><a href=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-33I0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-16051\" title=\"H\u01b0\u1edbng d\u1eabn Advanced Custom Field (ACF) 47\" src=\"https:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/02\/huong-dan-advanced-custom-field-acf-33I0.png\" alt=\"acf-google-maps-field\" width=\"700\" height=\"384\" \/><\/a><\/p>\n<p>Ch\u1ecdn gi\u00e1 tr\u1ecb Google Map nhanh ch\u00f3ng d\u1ef1a tr\u00ean b\u1ea3n \u0111\u1ed3.<\/p>\n<p><a href=\"http:\/\/www.advancedcustomfields.com\/resources\/field-types\/google-map\/\">Xem h\u01b0\u1edbng d\u1eabn<\/a><\/p>\n<h3 class=\"ftwp-heading\">L\u1eddi k\u1ebft<\/h3>\n<p>T\u1edbi \u0111\u00e2y b\u1ea1n ch\u1eafc \u0111\u00e3 hi\u1ec3u qua v\u00e0 bi\u1ebft c\u00e1ch s\u1eed d\u1ee5ng s\u01a1 s\u01a1 plugin Advanced Custom Field r\u1ed3i \u0111\u00fang kh\u00f4ng n\u00e0o? N\u1ebfu b\u1ea1n v\u1eabn ch\u01b0a hi\u1ec3u l\u1eafm v\u1ec1 plugin n\u00e0y, m\u00ecnh khuy\u1ebfn kh\u00edch c\u00e1c b\u1ea1n n\u00ean \u0111\u1ecdc k\u1ef9 t\u00e0i li\u1ec7u h\u01b0\u1edbng d\u1eabn v\u00ec m\u1ecdi v\u1ea5n \u0111\u1ec1 h\u1ea7u nh\u01b0 \u0111\u00e3 c\u00f3 \u1edf \u0111\u00f3.<\/p>\n<p>Hy v\u1ecdng v\u1edbi plugin n\u00e0y s\u1ebd gi\u00fap b\u1ea1n l\u00e0m vi\u1ec7c d\u1ec5 d\u00e0ng v\u00e0 chuy\u00ean nghi\u1ec7p h\u01a1n v\u1edbi t\u00ednh n\u0103ng custom field trong WordPress.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>M\u1eb7c d\u00f9 m\u00ecnh h\u01b0\u1edbng d\u1eabn \u1edf \u0111\u00e2y nh\u01b0ng ch\u1eafc ch\u1eafn s\u1ebd kh\u00f4ng \u0111\u1ea7y \u0111\u1ee7 v\u00ec m\u00ecnh ch\u1ec9 \u0111i v\u00e0o ph\u1ea7n tr\u1ecdng t\u00e2m, do \u0111\u00f3 h\u00e3y \u0111\u1ecdc th\u00eam\u00a0ACF Documentation\u00a0\u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 plugin n\u00e0y nh\u00e9. L\u00e0m quen v\u1edbi ACF Link t\u1ea3i plugin Sau khi c\u00e0i \u0111\u1eb7t xong b\u1ea1n v\u00e0o\u00a0Dashboard &gt;&gt; Custom Fields &gt;&gt; Custom Fields\u00a0\u0111\u1ec3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1042,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,11],"tags":[],"class_list":["post-1041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chia-se","category-thiet-ke-website"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/posts\/1041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/comments?post=1041"}],"version-history":[{"count":0,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/posts\/1041\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/media\/1042"}],"wp:attachment":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/media?parent=1041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/categories?post=1041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/tags?post=1041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}