This snippet gives the ability to remove the default product sortering dropdown select on the shop page. You can place the code in functions.php
.
Last active
September 25, 2022 09:11
-
-
Save corsonr/4a40615603682c7629b4323341dad215 to your computer and use it in GitHub Desktop.
WooCommerce: remove products ordering dropdown select in shop page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not include this if already open! Code goes in theme functions.php. | |
/** | |
* Remove WooCommerce default catalog ordering from shop page. | |
*/ | |
add_action( 'after_setup_theme', 'remove_woocommerce_catalog_ordering', 1 ); | |
function remove_woocommerce_catalog_ordering() { | |
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); // If using Storefront, replace 30 by 10. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment