Archives: Snippets
Untitled Snippet
fitsum ketema
Untitled Snippet
google.com, pub-9481928342352849, DIRECT, f08c47fec0942fa0Continue reading
Untitled Snippet
<meta name=”google-adsense-account” content=”ca-pub-9481928342352849″>Continue reading
Untitled Snippet
Get rid of Home
add_filter(‘pre_get_document_title’, function($title) { if (is_front_page()) return ‘Brooklyn Insurance Agency | Max J. Pollack & Sons’; return $title; });Continue reading
Gravity Forms Hook — BOL Upload Triggers Capture
add_action( ‘gform_after_submission_5’, ‘wcv_dynamic_bol_capture’, 10, 2 ); function wcv_dynamic_bol_capture( $entry, $form ) { $order_id = null; $bol_file_url = null; foreach ( $form[‘fields’] as $field ) { $label = strtolower( trim( $field->adminLabel ?: $field->label ) ); if ( in_array( $label, array( ‘order…Continue reading
Smooth Scroll
document.querySelectorAll(‘a[href^=”/#”]’).forEach(link => { link.addEventListener(‘click’, function(e) { e.preventDefault(); const target = document.querySelector(this.getAttribute(‘href’).replace(‘/’, ”)); if (target) { window.scrollTo({ top: target.offsetTop – 80, behavior: ‘smooth’ }); } }); }); “Continue reading
ACFW – Invalidate coupons for products with certain custom meta data
add_filter( ‘woocommerce_coupon_is_valid’, function( $valid, $coupon, $discount ) { $excluded_channels = $coupon->get_meta( ‘_excluded_og_channels’, true ); if ( empty( $excluded_channels ) ) { return $valid; } // Handle both a single stored string and a serialized array if ( ! is_array( $excluded_channels…Continue reading