Skip to content

Instantly share code, notes, and snippets.

@unoframille
Last active February 16, 2017 10:18
Show Gist options
  • Save unoframille/44879ccbac229cd0d509951040ce262b to your computer and use it in GitHub Desktop.
Save unoframille/44879ccbac229cd0d509951040ce262b to your computer and use it in GitHub Desktop.
Elimina la barra laterale dal tema StoreFront di WooCommerce
<?php
/**
* Plugin Name: StoreFront Remove Sidebar
* Plugin URI: https://francescomosca.info
* Description: Leva la sidebar dalle pagine WooCommerce dal template StoreFront
* Version: 1.0.0
* Author: fruitfulwp
* Author URI: https://francescomosca.info
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
add_action( 'get_header', 'remove_storefront_sidebar' );
add_action( 'wp_head', 'hook_css' );
function remove_storefront_sidebar() {
if ( is_woocommerce() or is_cart() or is_checkout()) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}
function hook_css() {
if ( is_woocommerce() or is_cart() or is_checkout()) {
echo '<style>body #primary { width: 100% !important; }</style>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment