{"id":54584,"date":"2017-10-10T08:58:23","date_gmt":"2017-10-10T11:58:23","guid":{"rendered":"https:\/\/wiki.samuelchopard.ch\/?p=54584"},"modified":"2019-03-18T14:29:19","modified_gmt":"2019-03-18T13:29:19","slug":"customize-the-woocommerce-breadcrumbs","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/customize-the-woocommerce-breadcrumbs\/","title":{"rendered":"Customize the WooCommerce breadcrumbs"},"content":{"rendered":"<p><!--more--><\/p>\n<p><strong>Change the &#8220;Home&#8221; text:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_home_text' );\nfunction jk_change_breadcrumb_home_text( $defaults ) {\n    \/\/ Change the breadcrumb home text from 'Home' to 'Apartment'\n  $defaults['home'] = 'Apartment';\n  return $defaults;\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Change the breadcrumb separators:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_delimiter' );\nfunction jk_change_breadcrumb_delimiter( $defaults ) {\n  \/\/ Change the breadcrumb delimeter from '\/' to '&gt;'\n  $defaults['delimiter'] = ' &amp;gt; ';\n  return $defaults;\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Change all the things:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">add_filter( 'woocommerce_breadcrumb_defaults', 'jk_woocommerce_breadcrumbs' );\nfunction jk_woocommerce_breadcrumbs() {\n    return array(\n            'delimiter'   =&gt; ' &#047; ',\n            'wrap_before' =&gt; '&lt;nav class=\"woocommerce-breadcrumb\" itemprop=\"breadcrumb\"&gt;',\n            'wrap_after'  =&gt; '&lt;\/nav&gt;',\n            'before'      =&gt; '',\n            'after'       =&gt; '',\n            'home'        =&gt; _x( 'Home', 'breadcrumb', 'woocommerce' ),\n        );\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Change the home link to a different URL:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );\nfunction woo_custom_breadrumb_home_url() {\n    return 'http:\/\/woothemes.com';\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Remove the breadcrumbs:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">add_action( 'init', 'jk_remove_wc_breadcrumbs' );\nfunction jk_remove_wc_breadcrumbs() {\n    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>For WooThemes (such as Storefront), see source page.<\/strong><\/p>\n<p>Source:\u00a0<a target=\"_blank\" href=\"https:\/\/docs.woocommerce.com\/document\/customise-the-woocommerce-breadcrumb\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.woocommerce.com\/document\/customise-the-woocommerce-breadcrumb\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Change the \"Home\" text: add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_home_text' ); function jk_change_breadcrumb_home_text( $defaults ) { \/\/ Change the breadcrumb home text from [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[47,75,128,161,244,327],"class_list":["post-54584","post","type-post","status-publish","format-standard","hentry","category-plugins","category-woocommerce","tag-breadcrumbs","tag-customize","tag-home","tag-links","tag-rename","tag-woocommerce"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=54584"}],"version-history":[{"count":1,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54584\/revisions"}],"predecessor-version":[{"id":54855,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54584\/revisions\/54855"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=54584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=54584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=54584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}