
{"id":3392,"date":"2014-04-18T00:16:55","date_gmt":"2014-04-18T00:16:55","guid":{"rendered":"http:\/\/tapchicntt.com\/?p=3392"},"modified":"2014-04-18T00:17:40","modified_gmt":"2014-04-18T00:17:40","slug":"wordpress-tao-breadcrumbs-khong-can-plugin","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/wordpress-tao-breadcrumbs-khong-can-plugin\/","title":{"rendered":"[WordPress] T\u1ea1o BreadCrumbs kh\u00f4ng c\u1ea7n Plugin"},"content":{"rendered":"<p>Breadcrumbs l\u00e0 m\u1ed9t t\u00ednh n\u0103ng gi\u00fap ng\u01b0\u1eddi d\u00f9ng d\u1ec5 d\u00e0ng \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn trang m\u00e0 h\u1ecd mu\u1ed1n, v\u00e0 n\u00f3 c\u0169ng r\u1ea5t h\u1eefu \u00edch cho vi\u1ec7c SEO trang web. C\u00f3 r\u1ea5t nhi\u1ec1u plugin gi\u00fap ch\u00fang ta t\u1ea1o breadcrumb cho trang WordPress. Tuy nhi\u00ean v\u00ec t\u00ednh ch\u1ea5t \u0111\u01a1n gi\u1ea3n c\u1ee7a n\u00f3, m\u00e0 m\u00ecnh khuy\u00ean c\u00e1c b\u1ea1n n\u00ean t\u1ef1 tay t\u1ea1o breadcrumb cho trang web c\u1ee7a m\u00ecnh.<br \/>\n<!--more--><br \/>\n<div style=\"width: 660px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dl.dropboxusercontent.com\/u\/1552467\/TapchiCNTT\/Wordpress\/wordpress-tao-breadcrumbs-khong-can-plugin.jpg\" width=\"650\" height=\"459\" alt=\"T\u1ea1o BreadCrumbs kh\u00f4ng c\u1ea7n Plugin\" class \/><p class=\"wp-caption-text\">T\u1ea1o BreadCrumbs kh\u00f4ng c\u1ea7n Plugin<\/p><\/div><\/p>\n<p>C\u00e1c b\u1ea1n ch\u1ec9 vi\u1ec7c \u0111\u01a1n gi\u1ea3n copy \u0111o\u1ea1n code b\u00ean d\u01b0\u1edbi v\u00e0 d\u00e1n (past) n\u00f3 v\u00e0o b\u00ean trong file functions.php (n\u1eb1m t\u1ea1i folder theme m\u00e0 c\u00e1c b\u1ea1n \u0111ang d\u00f9ng).<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction the_breadcrumb() {\r\n                echo '&lt;ul id=&quot;crumbs&quot;&gt;';\r\n        if (!is_home()) {\r\n                echo '&lt;li&gt;&lt;a href=&quot;';\r\n                echo get_option('home');\r\n                echo '&quot;&gt;';\r\n                echo 'Home';\r\n                echo &quot;&lt;\/a&gt;&lt;\/li&gt;&quot;;\r\n                if (is_category() || is_single()) {\r\n                        echo '&lt;li&gt;';\r\n                        the_category(' &lt;\/li&gt;&lt;li&gt; ');\r\n                        if (is_single()) {\r\n                                echo &quot;&lt;\/li&gt;&lt;li&gt;&quot;;\r\n                                the_title();\r\n                                echo '&lt;\/li&gt;';\r\n                        }\r\n                } elseif (is_page()) {\r\n                        echo '&lt;li&gt;';\r\n                        echo the_title();\r\n                        echo '&lt;\/li&gt;';\r\n                }\r\n        }\r\n        elseif (is_tag()) {single_tag_title();}\r\n        elseif (is_day()) {echo&quot;&lt;li&gt;Archive for &quot;; the_time('F jS, Y'); echo'&lt;\/li&gt;';}\r\n        elseif (is_month()) {echo&quot;&lt;li&gt;Archive for &quot;; the_time('F, Y'); echo'&lt;\/li&gt;';}\r\n        elseif (is_year()) {echo&quot;&lt;li&gt;Archive for &quot;; the_time('Y'); echo'&lt;\/li&gt;';}\r\n        elseif (is_author()) {echo&quot;&lt;li&gt;Author Archive&quot;; echo'&lt;\/li&gt;';}\r\n        elseif (isset($_GET&#x5B;'paged']) &amp;&amp; !empty($_GET&#x5B;'paged'])) {echo &quot;&lt;li&gt;Blog Archives&quot;; echo'&lt;\/li&gt;';}\r\n        elseif (is_search()) {echo&quot;&lt;li&gt;Search Results&quot;; echo'&lt;\/li&gt;';}\r\n        echo '&lt;\/ul&gt;';\r\n}\r\n<\/pre>\n<p>V\u00e0 b\u00e2y gi\u1edd, c\u00e1c b\u1ea1n m\u1edf file <strong>header.php<\/strong> v\u00e0 d\u00e1n \u0111o\u1ea1n code sau v\u00e0o v\u1ecb tr\u00ed m\u00e0 c\u00e1c b\u1ea1n mu\u1ed1n hi\u1ec3n th\u1ecb breadcrumbs:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php the_breadcrumb(); ?&gt;\r\n<\/pre>\n<p>Hy v\u1ecdng qua b\u00e0i vi\u1ebft n\u00e0y, c\u00e1c b\u1ea1n s\u1ebd c\u00f3 th\u00eam kinh nghi\u1ec7m trong vi\u1ec7c s\u1eed d\u1ee5ng WordPress v\u00e0 n\u00e2ng cao kh\u1ea3 n\u0103ng vi\u1ebft code c\u1ee7a m\u00ecnh.<\/p>\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Breadcrumbs l\u00e0 m\u1ed9t t\u00ednh n\u0103ng gi\u00fap ng\u01b0\u1eddi d\u00f9ng d\u1ec5 d\u00e0ng \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn trang m\u00e0 h\u1ecd mu\u1ed1n, v\u00e0 n\u00f3 c\u0169ng [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[],"class_list":["post-3392","post","type-post","status-publish","format-standard","hentry","category-thu-thuat-wordpress"],"views":410,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/3392","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=3392"}],"version-history":[{"count":0,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/3392\/revisions"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=3392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=3392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=3392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}