Skip to content

Instantly share code, notes, and snippets.

View Willem-Siebe's full-sized avatar

Willem-Siebe

View GitHub Profile
@Willem-Siebe
Willem-Siebe / functions.php
Created May 20, 2014 15:41
Remove TablePress plugin CSS in favor of using LESS from Twitter Bootstrap, see http://wordpress.org/support/topic/disable-standard-tablepress-css?replies=10.
// Remove TablePress plugin CSS in favor of using LESS from Twitter Bootstrap, see https://gist.github.com/Willem-Siebe/ba6428a1dcd6b767a818.
add_filter( 'tablepress_use_default_css', '__return_false' );
@Willem-Siebe
Willem-Siebe / functions.php
Created May 23, 2014 08:09
The return to shop button in WooCommerce empty-cart.php goes to the shop archive page. However, if we don't want a shop page and leave this option unset in WooCommerce settings, we need this button to go to our homepage. See http://codex.wordpress.org/Function_Reference/get_home_url. For help on filters see http://dev.themeblvd.com/tutorial/filt…
// The return to shop button in WooCommerce empty-cart.php goes to the shop archive page. However, if we don't want a shop page and leave this option unset in WooCommerce settings, we need this button to go to our homepage. See https://gist.github.com/Willem-Siebe/c1d70aeef75a3e60ab15.
function wsis_woocommerce_return_to_shop_redirect() {
return get_home_url();
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wsis_woocommerce_return_to_shop_redirect' );
@Willem-Siebe
Willem-Siebe / gist:2f2f64012b9cfe36df1a
Created May 25, 2014 15:20
Change the UL for WooCommerce product loop start and end if your are not using a list, but for example Twitter Bootstrap. There are two other ways of doing this, overwriting the WooCommerce template files or using your own templates files. See https://github.com/woothemes/woocommerce/issues/5197.
// Change the UL for WooCommerce product loop start and end if your are not using a list, but for example Twitter Bootstrap. See https://gist.github.com/Willem-Siebe/2f2f64012b9cfe36df1a.
function woocommerce_product_loop_start() {
echo '<div class="wsis-wc-product-loop">';
}
function woocommerce_product_loop_end() {
echo '</div>';
}
@Willem-Siebe
Willem-Siebe / functions.php
Created May 27, 2014 06:30
Register LESS stylesheet using the WP LESS plugin, download it here: http://wordpress.org/plugins/wp-less/. Register stylesheet(s) explained here: https://github.com/oncletom/wp-less/wiki/Common-Usage#Registering%20a%20LESS%20stylesheet.
// Register LESS stylesheet using the WP LESS plugin, see https://gist.github.com/Willem-Siebe/e7800869c3517d85614c.
function wsis_enqueue_styles() {
wp_enqueue_style('style-less', get_stylesheet_directory_uri().'/less/style.less');
}
add_action('wp_enqueue_scripts', 'wsis_enqueue_styles');
@Willem-Siebe
Willem-Siebe / style.less
Last active August 29, 2015 14:01
Add Font Awesome to your LESS stylesheet. My style.less file is placed inside a folder called 'less', the paths used below are relative from this directory. See http://fortawesome.github.io/Font-Awesome/3.2.1/get-started/, although I use a slightly different approach which is more update safe. First create your 'font-awesome' folder in your chil…
// Add Font Awesome to your LESS stylesheet, see https://gist.github.com/Willem-Siebe/dc6c94aa7dd17c54e9fd.
@import "../font-awesome/less/font-awesome.less";
@import "font-awesome/variables.less";
@Willem-Siebe
Willem-Siebe / variables.less
Last active August 29, 2015 14:01
Overwriting @FontAwesomePath using our own variables.less. You need to do this first: https://gist.github.com/Willem-Siebe/dc6c94aa7dd17c54e9fd.
// Variables
// --------------------------
// Overwriting @FontAwesomePath using our own variables.less, see https://gist.github.com/Willem-Siebe/e9eeca9db432e1a9ab50.
@FontAwesomePath: "../font-awesome/font/";
@Willem-Siebe
Willem-Siebe / invoice.php
Last active August 29, 2015 14:01
Add WooCommerce payment instructions for BACS and COD in your invoice template from WooCommerce PDF Invoices & Packing Slips, see http://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips. Support topic: http://wordpress.org/support/topic/payment-instructions-added-but-not-working. The action has been added in WooCommerce files …
<!-- Add WooCommerce payment instructions for BACS and COD in your invoice template from WooCommerce PDF Invoices & Packing Slips, see https://gist.github.com/Willem-Siebe/9f371aaaeab1320aaac2. -->
<?php do_action( 'woocommerce_thankyou_' . $wpo_wcpdf->export->order->payment_method, $wpo_wcpdf->export->order->id ); ?>
@Willem-Siebe
Willem-Siebe / invoice.php
Last active October 16, 2017 12:19
Add the three custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see http://wordpress.org/support/topic/adding-text-field-below-the-table.
<!-- Add the first custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. -->
<?php if ( $wpo_wcpdf->get_extra_1() ): ?>
<div id="extra1">
<?php $wpo_wcpdf->extra_1(); ?>
</div>
<?php endif; ?>
<!-- Add the second custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. -->
@Willem-Siebe
Willem-Siebe / functions.php
Last active August 29, 2015 14:02
Remove all Bootstrap 2.3.2 CSS from Toolset Bootstrap theme since I use the original LESS files of Bootstrap in my child theme. Remove from version 1.5 the style.css if you don't want to use it. See http://wp-types.com/forums/topic/demo-is-frustrating-me/#post-124761.
// Remove all Bootstrap 2.3.2 CSS from Toolset Bootstrap theme since I use the original LESS files of Bootstrap in my child theme, remove from version 1.5 the style.css if you don't want to use it, see https://gist.github.com/Willem-Siebe/0f2f2eafc444239d25fe.
function wsis_remove_toolset_bootstrap_CSS_files() {
wp_dequeue_style('wpbootstrap_bootstrap_responsive_css');
wp_dequeue_style('wpbootstrap_bootstrap_main_css');
wp_dequeue_style('toolset-bootstrap-theme-style');
}
add_action('wp_enqueue_scripts','wsis_remove_toolset_bootstrap_CSS_files',999);
@Willem-Siebe
Willem-Siebe / functions.php
Last active August 29, 2015 14:02
Remove CSS and JS from WooCommerce Views plugin, because it's conflicting with my Bootstrap LESS or because it's not needed! See http://wp-types.com/forums/topic/disable-wcviews-style-css/. It seems to only disable loading in frontend of the site (which is good) and not the backend of WordPress (which is fine).
// Remove CSS and JS from WooCommerce Views plugin, because it's conflicting with my Bootstrap LESS or because it's not needed! See https://gist.github.com/Willem-Siebe/681168b39da04ea356de.
function wsis_remove_woocommerce_views_assets() {
wp_dequeue_style('wcviews-style');
// To make the WooCommerce Tabs work.
wp_dequeue_script('woocommerce_views_custom_script');
}
add_action('wp_enqueue_scripts','wsis_remove_woocommerce_views_assets',999);