You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WooCommerce Products have no archive link. So we end up with an entry in $breadcrumbs like
[0] => 'Products'
where [0] should be a url.
Presumably this would be the case for any CPT object for which has_archive is not set or false. Checking for it is easy enough, but what to do in these events?
We probably ought to implement a check for WooCommerce, since this will be a common case. Beyond that some things that come to mind:
We could attempt to find taxonomies/terms belonging to the CPT.
We could insert a placeholder key and then output the PostType label without linking.
We could just bail out of that iteration and leave that bit of the breadcrumb out, since it's essentially inaccessible for a visitor anyway.
The text was updated successfully, but these errors were encountered:
Woo will add their breadcrumb by default on all shop pages.
To remove theme breadcrumbs on shop pages(avoid duplicate), just add
add_action ('wp' , 'woo_dup_disable_breadcrumb'); function woo_dup_disable_breadcrumb() { if ( is_woocommerce() ) { // Remove the breadcrumb. add_filter( 'beans_pre_load_fragment_breadcrumb', '__return_true' ); } }
It works, however, if you disable the woocommerce plugin, you need to remove the code above in function.php file.
I'm looking for the function that working if woo is disabled but no luck. Tried this solution https://docs.woocommerce.com/document/query-whether-woocommerce-is-activated/ but theme breadcrumb still appear with Woocommerce breadcrumb on shop pages.
@see https://community.getbeans.io/discussion/wrong-woocommerce-breadcrumbs/ for initial report.
WooCommerce Products have no archive link. So we end up with an entry in
$breadcrumbs
likewhere [0] should be a url.
Presumably this would be the case for any CPT object for which
has_archive
is not set or false. Checking for it is easy enough, but what to do in these events?We probably ought to implement a check for WooCommerce, since this will be a common case. Beyond that some things that come to mind:
The text was updated successfully, but these errors were encountered: