normalize css (the new normal)

// Add custom styles function add_the_new_normal_css() { wp_register_style( ‘the-new-normal-css’, ‘https://cdn.jsdelivr.net/gh/sarahschopick/the-new-normal.css@1f917841c3a1382d644952dcaefb67e947467e22/the-new-normal.css’, array(), ‘1.0.0’ ); wp_enqueue_style( ‘the-new-normal-css’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_the_new_normal_css’ );Continue reading

Add Divi Button Styling to GForms Buttons

add_filter( ‘gform_submit_button’, ‘add_divi_button_css_class’, 10, 2 ); add_filter( ‘gform_next_button’, ‘add_divi_button_css_class’, 10, 2 ); add_filter( ‘gform_previous_button’, ‘add_divi_button_css_class’, 10, 2 ); function add_divi_button_css_class( $button, $form ) { $fragment = WP_HTML_Processor::create_fragment( $button ); $fragment->next_token(); $fragment->add_class( ‘et_pb_button’ ); return $fragment->get_updated_html(); }Continue reading

Add Auto Sizes to Lazy Loaded images (copy)

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if ( ! isset( $attr[‘loading’] ) || ‘lazy’ !== $attr[‘loading’] || ! isset( $attr[‘sizes’] ) ) { return $attr; } // Skip if attribute was already added. if ( false !== strpos( $attr[‘sizes’], ‘auto,’…Continue reading

Add Auto Sizes to Lazy Loaded images

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if ( ! isset( $attr[‘loading’] ) || ‘lazy’ !== $attr[‘loading’] || ! isset( $attr[‘sizes’] ) ) { return $attr; } // Skip if attribute was already added. if ( false !== strpos( $attr[‘sizes’], ‘auto,’…Continue reading

Disable WordPress 6.5 Font Library

add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $editor_settings[‘fontLibraryEnabled’] = false; return $editor_settings; } ); // Disable the REST API for the font library. add_filter( ‘register_post_type_args’, function( $arg, $post_type ) { if ( ‘wp_font_family’ === $post_type || ‘wp_font_face’ === $post_type ) {…Continue reading