Set featured image aspect ratio
.featured-post-image { aspect-ratio: 16 / 9; object-fit: cover; }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
.featured-post-image { aspect-ratio: 16 / 9; object-fit: cover; }Continue reading
add_filter( ‘upload_mimes’, function( $mimes ) { $mimes[‘woff’] = ‘application/x-font-woff’; $mimes[‘woff2’] = ‘application/x-font-woff2’; $mimes[‘ttf’] = ‘application/x-font-ttf’; $mimes[‘svg’] = ‘image/svg+xml’; $mimes[‘eot’] = ‘application/vnd.ms-fontobject’; return $mimes; } );Continue reading
add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $css = wp_get_custom_css_post()->post_content; $editor_settings[‘styles’][] = array( ‘css’ => $css ); return $editor_settings; } );Continue reading
function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading
function replace_admin_bar_text() { global $wp_admin_bar; $wp_admin_bar->add_node(array( ‘id’ => ‘site-name’, ‘title’ => __(”), )); $wp_admin_bar->add_node(array( ‘id’ => ‘my-account’, ‘title’ => ‘👤‘, ‘href’ => get_edit_profile_url(), )); } add_action(‘wp_before_admin_bar_render’, ‘replace_admin_bar_text’, 0); function remove_wp_logo() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘wp-logo’); } add_action(‘wp_before_admin_bar_render’, ‘remove_wp_logo’, 0); function remove_comments()…Continue reading
jQuery(“input , textarea”).focus(function(){ jQuery(this).parents(‘.elementor-field-group’).addClass(‘focused’); }); jQuery(“input , textarea”).blur(function(){ var inputValue = jQuery(this).val(); if ( inputValue == “” ) { jQuery(this).parents(‘.elementor-field-group’).removeClass(‘focused’); } });Continue reading
/** * Add fields to the registration form. * * @param array $fields * @return array */ add_filter( ‘charitable_user_registration_fields’, function( $fields ) { /* Add a text field. */ $fields[‘text_field’] = [ ‘type’ => ‘text’, ‘label’ => ‘My Text Field’,…Continue reading