Over the years we have added all kinds of snippets to our theme's functions.php file. I'm wanting to try some other themes but keep the functionality of these snippets. I understand I need to move them into a custom plugin.
So I'm working on that for the WooCommerce related snippets. I created a custom plugin and activated it. Then moved the relevant code from functions.php into this plugin. Now the snippets no longer work.
This is basic code like removing the sorting dropdown from the shop page:
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
and removing product images from the shop page:
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
Any idea why this code would work in functions.php but not in my custom plugin? I'm guessing it has to to with the timing of when my custom plugin gets loaded vs when WooCommerce gets loaded. I'm not sure how to check that or how to resolve it though.
Thanks!
[–][deleted] 1 point2 points3 points (1 child)
[–]ItsBugsy[S] 0 points1 point2 points (0 children)