Skip to content

Instantly share code, notes, and snippets.

@aderaaij
aderaaij / wc-remove-related-products.php
Created July 17, 2014 10:23
Remove related products
<?php
function woo_remove_tab($tabs) {
unset($tabs['reviews']);
unset($tabs['description']);
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_tab', 98);
@aderaaij
aderaaij / enqueue-conditional.php
Created July 15, 2014 10:09
Conditionally load styleshheet
<?php
wp_enqueue_style( 'ie', get_template_directory_uri() . 'assets/css/ie.css', array(''), '' );
$wp_styles->add_data( 'fysiodeaker-ie', 'conditional', 'lt IE 9' )
@aderaaij
aderaaij / remove-mote-tag-link-jump.php
Created July 15, 2014 10:03
Remove the # anchor after more links
@aderaaij
aderaaij / flush-rewrite.php
Created July 15, 2014 09:58
Flush Permalinks. To flush all the rewrite rules, Uncomment, safe, refresh site & admin and comment out again
<?php
add_action('admin_init', 'flush_rewrite_rules');
@aderaaij
aderaaij / rem-calc.scss
Created July 14, 2014 17:57
Rem calculator
$baseline-px: 14px;
@mixin rem($property, $px-values) {
// Convert the baseline into rems
$baseline-rem: $baseline-px / 1rem * 1;
// Print the first line in pixel values
#{$property}: $px-values;
// If there is only one (numeric) value, return the property/value line for it.
@if type-of($px-values) == "number" {
#{$property}: $px-values / $baseline-rem; }
@aderaaij
aderaaij / font-smoothing.scss
Created July 14, 2014 17:54
http://maximilianhoffmann.com/posts/better-font-rendering-on-osx Better font-rendering (on OS/X). Use like: @mixin font-smoothing($value: on) { @if $value == on { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @else { -webkit-font-smoothing: subpixel-antialiased; -moz-osx-font-smoothing: auto; } }
@mixin font-smoothing($value: on) {
@if $value == on {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@else {
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: auto;
}
}
@aderaaij
aderaaij / wc-remove-catalog-ordering.php
Created July 9, 2014 17:42
Remove sorting dropdown
<?php
// remove sorting dropdown
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
@aderaaij
aderaaij / wc-remove-single-product-salesflash.php
Created July 9, 2014 17:40
Remove sales flash on single product
<?php
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
@aderaaij
aderaaij / wc-loop-image-wrap.php
Created July 9, 2014 17:39
Add a wrapper around the archive product image: https://gist.github.com/krogsgard/3015581
<?php
/* This snippet removes the action that inserts thumbnails to products in teh loop
* and re-adds the function customized with our wrapper in it.
* It applies to all archives with products.
*
* @original plugin: WooCommerce
* @author of snippet: Brian Krogsard
*/
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);