Skip to content

Instantly share code, notes, and snippets.

@skymaiden
skymaiden / functions.php
Created September 2, 2018 19:53
Format WooCommerce currencies per WPML language
<?php
// Show currency symbol on the right for prices in French language
function filter_currency_pos( $format ) {
$current_lang = apply_filters( 'wpml_current_language', NULL );
if ($current_lang == 'fr') {
$format = '%2$s&nbsp;%1$s';
}
return $format;
};
@skymaiden
skymaiden / removeClassRegex
Created July 21, 2014 09:22
Remove class by regex
var removeClassRegex = function($element, regex) {
return $element.attr('class', function(i, c) {
return c.replace(regex, '');
});
};
@skymaiden
skymaiden / config.rb
Created June 23, 2014 22:12
Starter config.rb
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "assets/css"
sass_dir = "assets/sass"
images_dir = "assets/images"
javascripts_dir = "assets/js"
@skymaiden
skymaiden / social-sharing-links.html
Last active December 29, 2015 16:09
Simple social sharing links (no JS).
@skymaiden
skymaiden / scrolltop
Created June 20, 2013 13:01
Simple animated "scroll to top" button script
$('#back-top').on('click', function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});