Skip to content

Instantly share code, notes, and snippets.

@amielucha
amielucha / functions.php
Created January 24, 2017 15:49 — forked from fuyuko/functions.php
Cheatsheet - WooCommerce Customization in functions.php
<?php
//Add a stylesheet after default style.css
wp_enqueue_style( 'my-css', get_template_directory_uri() . 'my-css.css', array('themename-style'));
//WooCommerce - Sort products by SKU
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_catalog_orderby');
function custom_woocommerce_catalog_orderby( $args ) {
$args['meta_key'] = '_sku';
$args['orderby'] = 'meta_value';
$args['order'] = 'asc';