
{"id":2255,"date":"2013-08-05T01:49:23","date_gmt":"2013-08-05T01:49:23","guid":{"rendered":"http:\/\/tapchicntt.com\/?p=2255"},"modified":"2023-08-10T08:58:16","modified_gmt":"2023-08-10T01:58:16","slug":"wordpress-xay-dung-them-wordpress-don-gian","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/wordpress-xay-dung-them-wordpress-don-gian\/","title":{"rendered":"[WordPress] X\u00e2y d\u1ef1ng template wordpress \u0111\u01a1n gi\u1ea3n"},"content":{"rendered":"\n<p>WordPress l\u00e0 m\u1ed9t m\u00e3 ngu\u1ed3n m\u1edf mi\u1ec5n ph\u00ed gi\u00fap b\u1ea1n m\u1ed9t website \u0111\u01a1n gi\u1ea3n v\u00e0 hi\u1ec7u qu\u1ea3 trong th\u1eddi bu\u1ed5i c\u00f4ng ngh\u1ec7 hi\u1ec7n. C\u1ef1c k\u1ef3 \u0111\u01a1n gi\u1ea3n t\u1eeb kh\u00e2u c\u00e0i \u0111\u1eb7t, t\u00f9y bi\u1ebfn cho \u0111\u1ebfn qu\u1ea3n l\u00fd, b\u1ea3o m\u1eadt. WordPress (WP) l\u00e0 m\u1ed9t trong nh\u1eefng n\u1ec1n t\u1ea3ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng r\u1ea5t ph\u1ed5 bi\u1ebfn \u0111\u1ec3 x\u00e2y d\u1ef1ng website, blog c\u00e1 nh\u00e2n \u0111\u1ebfn nh\u1eefng trang b\u00e1n h\u00e0ng tr\u1ef1c tuy\u1ebfn.<\/p>\n\n\n\n<p>Trong b\u00e0i vi\u1ebft n\u00e0y, t\u00f4i s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n x\u00e2y d\u1ef1ng template wordpress \u0111\u01a1n gi\u1ea3n.<\/p>\n\n\n\n<p>\u0110\u1ea7u ti\u00ean, b\u1ea1n v\u00e0o th\u01b0 m\u1ee5c wp-content\/themes, t\u1ea1i \u0111\u00e2y b\u1ea1n t\u1ea1o 1 folder m\u1edbi. S\u1ebd l\u00e0 t\u00ean c\u1ee7a theme.<\/p>\n\n\n\n<p>V\u00ed d\u1ee5, t\u1ea1o th\u01b0 m\u1ee5c c\u00f3 t\u00ean l\u00e0 <strong>MobileStore<\/strong> (V\u00ec s\u1ebd c\u00f3 Series b\u00e0i h\u01b0\u1edbng d\u1eabn t\u1ea1o 1 trang b\u00e1n h\u00e0ng tr\u1ef1c tuy\u1ebfn kh\u00f4ng c\u1ea7n plugin).<\/p>\n\n\n\n<p>Ti\u1ebfp theo b\u1ea1n c\u1ea7n nh\u1eefng t\u1ea1o nh\u1eefng file sau \u0111\u00e2y \u0111\u1ec3 c\u00f3 \u0111\u01b0\u1ee3c m\u1ed9t theme wordpress \u0111\u01a1n gi\u1ea3n:<\/p>\n\n\n\n<p><strong>header.php<\/strong> \u2013 Ch\u1ee9a n\u1ed9i d\u1ee5ng ph\u1ea7n header c\u1ee7a theme.<br><strong>index.php<\/strong> \u2013 Ph\u1ea7n ch\u00ednh c\u1ee7a theme, ch\u00ednh l\u00e0 trang ch\u1ee7 khi truy c\u1eadp.<br><strong>sidebar.php<\/strong> \u2013 Ch\u1ee9a ph\u1ea7n n\u1ed9i dung sidebar.<br><strong>footer.php<\/strong> \u2013 Ch\u1ee9a n\u1ed9i d\u1ee5ng footer.<br><strong>style.css<\/strong> \u2013 Ch\u1ee9a c\u00e1c th\u1ebb css c\u1ee7a theme.<br><strong>single.php<\/strong> &#8211; Ph\u1ea7n n\u1ed9i dung b\u00e0i vi\u1ebft c\u1ee7a wordpress.<br><strong>screenshot.jpg\/png<\/strong> &#8211; H\u00ecnh \u1ea3nh \u0111\u1ea1i di\u1ec7n cho Themes WordPress<\/p>\n\n\n\n<p><strong>L\u01b0u \u00fd<\/strong>: Khi c\u00e1c b\u1ea1n t\u1ea1o ra c\u00e1c file c\u00f3 t\u00ean nh\u01b0 th\u1ebf n\u00e0y trong folder theme, WordPress s\u1ebd t\u1ef1 nh\u1eadn bi\u1ebft \u0111\u01b0\u1ee3c file n\u00e0o s\u1ebd ch\u1ee9a n\u1ed9i dung v\u00e0 ch\u1ee9c n\u0103ng g\u00ec.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">N\u1ed9i dung file CSS<\/h2>\n\n\n\n<p>N\u1ed9i dung file <strong>style.css<\/strong> bao g\u1ed3m 2 ph\u1ea7n:<\/p>\n\n\n\n<p>1. Ph\u1ea7n gi\u1edbi thi\u1ec7u theme WordPress.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n\/*\nTheme Name: Mobile Store\nTheme URI: http:\/\/themescss.com\/\nDescription: Shop mobile online.\nAuthor: Free Gallery Template\nAuthor URI: http:\/\/themescss.com\/\nVersion: 1.0\nTags: shop online, mobile store, store, mobile\nLicense:\nLicense URI:\nGeneral comments (optional).\n*\/\n<\/pre><\/div>\n\n\n<p>2. Ph\u1ea7n CSS cho theme Wordpess.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">V\u00ed d\u1ee5<\/h2>\n\n\n\n<p>B\u1ea1n mu\u1ed1n g\u1ecdi file <strong>hearder.php<\/strong> th\u00ec b\u1ea1n ch\u1ec9 c\u1ea7n d\u00f9ng h\u00e0m <strong>get_header();<\/strong>, WordPress s\u1ebd ch\u00e8n file <strong>hearder.php<\/strong> v\u00e0 v\u1ecb tr\u00ed \u0111\u00f3.<\/p>\n\n\n\n<p>T\u01b0\u01a1ng t\u1ef1 nh\u01b0 v\u1eady, trong file index.php ch\u00fang ta s\u1ebd g\u1ecdi c\u00e1c v\u1ecb tr\u00ed nh\u01b0 sau:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/\/N\u1ed9i dung index.php\n\/\/Ch\u00e8n header.php\n\nget_header();\n\n\/\/---------------------------------------\n\/\/ N\u1ed9i dung ch\u00ednh c\u1ee7a website -- Content\n\/\/---------------------------------------\n\n\/\/Ch\u00e8n sidebar.php\nget_sidebar();\n\n\/\/Ch\u00e8n footer.php\nget_footer();\n?&gt;\n<\/pre><\/div>\n\n\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress l\u00e0 m\u1ed9t m\u00e3 ngu\u1ed3n m\u1edf mi\u1ec5n ph\u00ed gi\u00fap b\u1ea1n m\u1ed9t website \u0111\u01a1n gi\u1ea3n v\u00e0 hi\u1ec7u qu\u1ea3 trong th\u1eddi bu\u1ed5i [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":6979,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[137],"tags":[],"class_list":["post-2255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"views":381,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/2255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/comments?post=2255"}],"version-history":[{"count":3,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/2255\/revisions"}],"predecessor-version":[{"id":8082,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/2255\/revisions\/8082"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media\/6979"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=2255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=2255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=2255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}