Archives: Snippets
Home page
add_action(‘wp_head’, ‘ggs_homepage_schema_1901’, 20); function ggs_homepage_schema_1901() { if (!is_page(1901)) { return; } $schema = [ ‘@context’ => ‘https://schema.org’, ‘@graph’ => [ [ ‘@type’ => ‘ProfessionalService’, ‘@id’ => ‘https://goodguysseo.com/#organization’, ‘name’ => ‘Good Guys SEO’, ‘url’ => ‘https://goodguysseo.com/’, ‘telephone’ => ‘+1-917-402-3438′, ’email’ =>…Continue reading
Untitled Snippet
Disable Geolocation Current Location if the page URL contains Prefill by URL parameters targeting an address field
/** * Fix: WPForms Prefill by URL takes priority over Geolocation Current Location. * * When “Current Location” is enabled in WPForms > Settings > Geolocation, * the geolocation JS overwrites address fields that were pre-filled via URL * parameters…Continue reading
PayPal Commerce – PayPal Checkout using only the PayPal button
/** * Hide Venmo and Pay Later buttons from PayPal Commerce field. * Also hides Apple Pay, Google Pay buttons and Pay Later messages. * * @link https://wpforms.com/developers/wpforms_wp_footer_end/ */ function wpf_hide_paypal_commerce_buttons() { ?>Continue reading
PayPal Commerce – Horizontal layout for payment buttons
/** * PayPal Commerce customizations for form 877: * – Horizontal layout for payment buttons * – Disable card funding source from SDK * – Hide “Powered by PayPal” element * * @link https://wpforms.com/developers/wpforms_wp_footer_end/ */ // Inject CSS for horizontal…Continue reading
Untitled Snippet
add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘saphie_custom_add_to_cart_text’ ); add_filter( ‘woocommerce_product_add_to_cart_text’, ‘saphie_custom_add_to_cart_text’ ); function saphie_custom_add_to_cart_text() { return ‘ADD TO BAG’; }Continue reading
Allow SVG/JPEG/WEBP/ICO/AVIF Files Upload
function allow_additional_mime_types($mime_types) { $mime_types[‘jpeg’] = ‘image/jpeg’; $mime_types[‘svg’] = ‘image/svg+xml’; $mime_types[‘webp’] = ‘image/webp’; $mime_types[‘avif’] = ‘image/avif’; $mime_types[‘ico’] = ‘image/vnd.microsoft.icon’; return $mime_types; } add_filter(‘upload_mimes’, ‘allow_additional_mime_types’);Continue reading
Test one
echo “Hello dolly!”;Continue reading