Created
October 15, 2013 21:55
-
-
Save gspearce/6999254 to your computer and use it in GitHub Desktop.
WooCommerce snippet to create a view all products option for every category or search result page.
This file contains hidden or 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 | |
| /* Don't forget to remove the opening and closing PHP tags */ | |
| if( isset( $_GET['show_all'] ) ){ | |
| add_filter( 'loop_shop_per_page', create_function( '$cols', 'return -1;' ) ); | |
| } else { | |
| add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 10;' ) ); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment