Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Lucas Jahn lucasjahn

🏠
Working from home
View GitHub Profile
@lucasjahn
lucasjahn / functions.php
Last active January 18, 2023 06:58
Woocommerce Checkout - Display custom inline error messages (including custom validation messages)
View functions.php
<?php
/**
* adds custom js file to handle inline error messages
*/
add_action( 'woocommerce_after_checkout_form', 'add_custom_validation_script', 20 );
function add_custom_validation_script() {
wp_enqueue_script(
@lucasjahn
lucasjahn / gtm-maps-initeraction-tracking.js
Created November 28, 2019 00:01
Google Tag Manager (GTM) - Google Maps Interaction Tracking
View gtm-maps-initeraction-tracking.js
(function () {
/**
* sends a custom event with a given type to google analytics
*
* @param {String} type - type of the event to send
*/
function sendMapEvent(type) {
if(!readCookie('googleMapInteracted')) {
dataLayer.push({
'event': 'googlemaps',
@lucasjahn
lucasjahn / .htaccess
Created February 25, 2016 07:45 — forked from seoagentur-hamburg/.htaccess
Die optimale .htaccess-Datei für mehr Speed und Sicherheit
View .htaccess
# ----------------------------------------------------------------------
# | Komprimierung und Caching |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#