Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / remove-mote-tag-link-jump.php
Created July 15, 2014 10:03
Remove the # anchor after more links
@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' )
<?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 / wc-remove-related-products.php
Created July 17, 2014 10:23
Remove related products
@aderaaij
aderaaij / wc-npr-filter-phone.php
Created July 17, 2014 10:36
Phonenumber not required
<?php
//phone number not required
add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 );
function wc_npr_filter_phone( $address_fields ) {
$address_fields['billing_phone']['required'] = false;
return $address_fields;
}
@aderaaij
aderaaij / wc-custom-continue-redirect.php
Created July 17, 2014 13:25
Changes link destination of 'Continue Shopping' button on cart page http://webandtechstuff.com/continue-shopping-button-woocommerce-cart/
<?php
// Changes link destination of 'Continue Shopping' button on cart page
add_filter( 'woocommerce_continue_shopping_redirect', 'my_custom_continue_redirect' );
function my_custom_continue_redirect( $url ) {
return 'http://mydomain.com/url';
}