Có thể bạn quan tâm
- Thêm nội dung vào trước và sau giá của sản phẩm trong Woocommerce
- Chức năng theo dõi đơn hàng cho woocommerce
- Thêm lựa chọn tỉnh/thành phố vào form checkout của woocommerce
- Hướng dẫn xóa product, product-category trong đường dẫn của woocommerce
- Thay đổi cách hiển thị giá cho các Variable Product trong Woocommerce
Trong nhiều trường hợp bạn không thích hiển thị sidebar trong trang chi tiết sản phẩm thì bạn nào thế nào?
Dưới đây là giải pháp cho bạn ….
hãy chèn đoạn code bên dưới vào functions.php trong theme của bạn
Bỏ sidebar trong phần chi tiết sản phẩm
add_action('wp', create_function("", "if (is_archive(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") ); remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
Bỏ sidebar ở mọi nơi trong web
add_action('wp', create_function("", "if (is_singular(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") ); remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
Chúc các bạn thành công^^
- Bình luận