This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/inc/woocommerce.php

37 lines
865 B
PHP
Raw Normal View History

2015-09-09 08:58:25 +00:00
<?php
/**
* Add WooCommerce support
*
* @package understrap
*/
add_action( 'after_setup_theme', 'woocommerce_support' );
2016-11-19 09:46:50 +00:00
if ( ! function_exists( 'woocommerce_support' ) ) {
2016-11-21 17:12:36 +00:00
/**
* Declares WooCommerce theme support.
*/
2016-11-01 19:36:43 +00:00
function woocommerce_support() {
2016-11-19 09:46:50 +00:00
add_theme_support( 'woocommerce' );
2016-11-01 19:36:43 +00:00
}
2016-11-19 09:46:50 +00:00
}
/**
2017-02-11 09:15:59 +00:00
* Remove basic WooCOmmerce hooks.
*/
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
2016-11-19 09:46:50 +00:00
2017-02-11 09:15:59 +00:00
/**
* Hook in custom WooCommerce content area.
*/
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
2016-11-19 09:46:50 +00:00
2017-02-11 09:15:59 +00:00
function my_theme_wrapper_start() {
echo '<section id="main">';
2016-11-19 09:46:50 +00:00
}
2017-02-11 09:15:59 +00:00
function my_theme_wrapper_end() {
echo '</section>';
}