Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1426626
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questioni was just struggle for hours now trying to deal with the breadcrumb of woocommerce, I just saw that with a normal function it doesnt work..
add_filter( 'woocommerce_breadcrumb_defaults', 'custom_breadcrumb');
function custom_breadcrumb() {
return array(
'delimiter' => '<li class="mx-2 text-gray-500">/</li>',
'wrap_before' => '<ol class="breadcrumb flex text-xs uppercase text-gray-400 font-medium">',
'wrap_after' => '</ol>',
'before' => '<li class="hover:text-blue-500">',
'after' => '</li>',
'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ),
);
}
but the closure one bellow works
add_filter( 'woocommerce_breadcrumb_defaults', function() {
return array(
'delimiter' => '<li class="mx-2 text-gray-500">/</li>',
'wrap_before' => '<ol class="breadcrumb flex text-xs uppercase text-gray-400 font-medium">',
'wrap_after' => '</ol>',
'before' => '<li class="hover:text-blue-500">',
'after' => '</li>',
'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ),
);
} );
Anyone can explain why it doesnt work or where i failed?
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questioni was just struggle for hours now trying to deal with the breadcrumb of woocommerce, I just saw that with a normal function it doesnt work..
add_filter( 'woocommerce_breadcrumb_defaults', 'custom_breadcrumb');
function custom_breadcrumb() {
return array(
'delimiter' => '<li class="mx-2 text-gray-500">/</li>',
'wrap_before' => '<ol class="breadcrumb flex text-xs uppercase text-gray-400 font-medium">',
'wrap_after' => '</ol>',
'before' => '<li class="hover:text-blue-500">',
'after' => '</li>',
'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ),
);
}
but the closure one bellow works
add_filter( 'woocommerce_breadcrumb_defaults', function() {
return array(
'delimiter' => '<li class="mx-2 text-gray-500">/</li>',
'wrap_before' => '<ol class="breadcrumb flex text-xs uppercase text-gray-400 font-medium">',
'wrap_after' => '</ol>',
'before' => '<li class="hover:text-blue-500">',
'after' => '</li>',
'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ),
);
} );
Anyone can explain why it doesnt work or where i failed?
Share Improve this question asked Feb 13, 2020 at 19:42 Jonathan V.Jonathan V. 11 bronze badge 1 |1 Answer
Reset to default 0My bad.. it was the namespace
add_filter( 'woocommerce_breadcrumb_defaults', 'mynamespace\\custom_breadcrumb');
本文标签: Woocommerce woocommercebreadcrumbdefaults filter
版权声明:本文标题:Woocommerce woocommerce_breadcrumb_defaults filter 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744745819a2622871.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
custom_breadcrumb()
somewhere on your site. Try changing it to something more unique, to see if that helps. – Jacob Peattie Commented Feb 14, 2020 at 16:08