Advertisement
firoze

woocommerce support

Mar 26th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // keep this code into functions.php
  2.  
  3.  
  4. // woocommerce support
  5. add_action( 'after_setup_theme', 'woocommerce_support' );
  6. function woocommerce_support() {
  7. add_theme_support( 'woocommerce' );
  8.  
  9. }
  10.  
  11. // Using hooks for woocommerce
  12. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
  13. remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
  14.  
  15.  
  16.  
  17. // Then hook in your own functions to display the wrappers your theme requires
  18.  
  19. add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
  20. add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
  21.  
  22. function my_theme_wrapper_start() {
  23. echo '<section id="main">';
  24. }
  25.  
  26. function my_theme_wrapper_end() {
  27. echo '</section>';
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement