Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created September 28, 2020 11:56
Show Gist options
  • Select an option

  • Save yousufansa/718220365ae799e88b65355b2514aaee to your computer and use it in GitHub Desktop.

Select an option

Save yousufansa/718220365ae799e88b65355b2514aaee to your computer and use it in GitHub Desktop.
Bookworm - Display Header v1 Topbar Cart on Mobile
if ( ! function_exists( 'bw_child_site_header_icons_wc_cart_args' ) ) {
function bw_child_site_header_icons_wc_cart_args( $links ) {
if ( isset( $links['my_cart'] ) ) {
$links['my_cart']['item_class'] = 'd-block';
}
return $links;
}
}
if ( ! function_exists( 'bw_child_topbar_display_wc_cart_header_v1_mobile' ) ) {
function bw_child_topbar_display_wc_cart_header_v1_mobile() {
add_filter( 'bookworm_site_header_icons_links', 'bw_child_site_header_icons_wc_cart_args', 20 );
}
}
add_action( 'bookworm_header_v1', 'bw_child_topbar_display_wc_cart_header_v1_mobile', 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment