Exemple #1
0
    /**
     * WooCommerce categories loop
     *
     */
    function theshop_section_cats()
    {
        if (!theshop_woocommerce_active() || !get_theme_mod('cats_activate', 1)) {
            return;
        }
        $title = get_theme_mod('cats_title', 'Product categories');
        $number = get_theme_mod('cats_number', '3');
        ?>

	<section class="home-section cats-loop">
		<div class="container">
			<?php 
        if ($title) {
            ?>
			<h2 class="section-title"><span><?php 
            echo esc_html($title);
            ?>
</span></h2>
			<?php 
        }
        ?>
			<div class="inner-section">
			<?php 
        echo do_shortcode('[product_categories number="' . $number . '" parent="0" columns="3"]');
        ?>
			</div>
		</div>
	</section>

	<?php 
    }
Exemple #2
0
/**
 * Woocommerce compatibility
 *
 * @package TheShop
 */
//Check if Woocommerce is active
function theshop_woocommerce_active()
{
    if (class_exists('woocommerce')) {
        return true;
    } else {
        return false;
    }
}
if (!theshop_woocommerce_active()) {
    return;
}
/**
 * Declare support
 */
add_action('after_setup_theme', 'theshop_woocommerce_support');
function theshop_woocommerce_support()
{
    add_theme_support('woocommerce');
}
/**
 * Remove default WooCommerce CSS
 */
function theshop_dequeue_styles($enqueue_styles)
{