Tagged: categories, enfold, Tags
-
AuthorPosts
-
December 10, 2017 at 12:40 pm #887089
Hello,
I’m not looking for a CSS fix to this but a PHP fix.
I’m trying to move the categories and tags part further down under the tabs. I have the code to remove and add categories and tags, however, this theme does not allow me to remove the categories and tags section no matter what.
This code should work because it works with other themes:
//Supposed to remove Categories and Tags meta remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
Please provide me with the PHP code that I need to remove categories the proper way.
Kind Regards,
Con- This topic was modified 6 years, 11 months ago by ConStambo.
December 11, 2017 at 12:30 pm #887336Hey ConStambo,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaDecember 11, 2017 at 1:18 pm #887371Hello Victoria,
I’m not sure what viewing the website will do as this is PHP related and so it will be all backend? I’m not getting server errors or anything, just the PHP code does not work when it should. This action is even specified in woocommerce-template-hooks.php file in the woocommerce (the plugin) folder and in the themes config.php file (config-woocommerce folder) for when a password isn’t set. I’ve searched the config.php file to see if you guys have overridden it with anything and nothing comes up.
Thing is I’d like to use to actually remove categories and tags and then I’m going to add it in another part of the page with a hook which is why I cannot use CSS to do so. This seems to be happening with your theme. Same thing happens when I’ve played around with some other PHP that should work. E.g. to remove all tabs without using a function with unset. This code should work in general –
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
Kind Regards,
ConDecember 14, 2017 at 3:04 am #888706Hi,
Thank you for the update.
Please replace it with the following code.
add_action('after_setup_theme', function() { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_meta', 2 ); });
This is going to render the categories after the tabs.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.