Skip to content

Instantly share code, notes, and snippets.

View acki's full-sized avatar
👋
I may be slow to respond.

Christoph S. Ackermann acki

👋
I may be slow to respond.
View GitHub Profile
// Lade erst wenn Dokument und Elemente ready
jQuery(function() {
// Für alle Bilder mit der Klasse .person-img...
jQuery('.person-img').each( function( image ) {
// Bilder preload im Hintergrund
imageObj = new Image();
imageObj.src = jQuery(this).attr('src').replace(/_flat/g, '_pic');
// Mouseover Funktionsbinding
jQuery(this).live('mouseover', function() {
@acki
acki / helpers.php
Last active January 20, 2019 18:21
Helper for saving queries when using ACF in WordPress
<?php
// get field function for ACF without using ACF and generating additional queries (normally)
function get( $selector, $post_id = false, $format_value = true ) {
if( function_exists( 'get_post_meta' ) && function_exists( 'acf_get_valid_post_id' ) ) {
$post_id = acf_get_valid_post_id( $post_id );
// Search the data in post meta
@acki
acki / functions.php
Last active November 18, 2020 22:42
Dirty fix for WooCommerce rounding problems due to non-round tax values
<?php
/*
* WooCommerce dirty rounding fix for special tax values (7.7 in Switzerland)
* Rounding to 0.05 instead of 0.01
* created by Christoph S. Ackermann
* https://www.cubetech.ch
* 05.01.2018
*/