[Plugin: Woocommerce] Not sure about this Hook thing, to intergrate with theme
-
Hi
I found https://wcdocs.woothemes.com/codex/third-party-custom-theme-compatibility/
And frankly I don’t understand it.
The hook method is more involved that using woocommerce_content, but is more flexible. This is similar to the method we use when creating our themes. It’s also the method we use to integrate nicely with Twenty Ten and Eleven.
By inserting a few lines in your theme’s functions.php file, First unhook the WooCommerce wrappers;
1.remove_action( ‘woocommerce_before_main_content’, ‘woocommerce_output_content_wrapper’, 10);
2.remove_action( ‘woocommerce_after_main_content’, ‘woocommerce_output_content_wrapper_end’, 10);Then hook in your own functions to display the wrappers your theme requires;
add_action(‘woocommerce_before_main_content’, ‘my_theme_wrapper_start’, 10);
add_action(‘woocommerce_after_main_content’, ‘my_theme_wrapper_end’, 10);function my_theme_wrapper_start() {
echo ‘<section id=”main”>’;
}function my_theme_wrapper_end() {
echo ‘</section>’;
}Make sure that the markup matches that of your theme. If you’re unsure of which classes or ID’s to use take a look at your theme’s page.php for a guide.
I’ve tried adding this to lines 1. onward in the function.php file and nothing happens?
Please help.
- The topic ‘[Plugin: Woocommerce] Not sure about this Hook thing, to intergrate with theme’ is closed to new replies.