I try to remove the sort order drop-down in WOOCommerce by adding a remove_action call at the end of functions.php:
remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );
It does not work.
When I compared the syntax seems to be different in the Agama child functions.php.
The functions.php examples I found start with <?php and end with ?>.
In the Agama child functions.php the end tag ?> is missing.
Is my problem related to that? If I add the ?> tag it does not work at all.
Thanks in advance,
Martin
This topic was modified 6 years, 2 months ago by ov.
Omitting PHP close tag is common practice using by many developers.
Omitting the closing tag is just one solution for avoiding blanks and other characters at the end of file. For example any char which is accidentally added behind the closing tag would trigger an error when trying to modify header info later.
Omitting the closing tag is kind of “good practice” referring to many coding guidelines.
For removing products filter you have in-build theme option to disable it, just go to: Appearance -> Customize -> WooCommerce -> Products Filter -> Off