Category: Admin
Remove Google Fonts (non-Elementor)
function disable_google_fonts() { return false; } add_filter( ‘print_google_fonts’, ‘disable_google_fonts’ );Continue reading
Remove Google Fonts (Elementor)
add_filter( ‘elementor/frontend/print_google_fonts’, ‘__return_false’ );Continue reading
Ensure Webfont is Loaded (non-Elementor)
function custom_font_display( $current_value, $font_family, $data ) { return ‘swap’; } add_filter( ‘font_display’, ‘custom_font_display’, 10, 3 );Continue reading
Ensure Webfont is Loaded (Elementor)
add_filter( ‘elementor_pro/custom_fonts/font_display’, function( $current_value, $font_family, $data ) { return ‘swap’; }, 10, 3 );Continue reading
Remove Gutenberg Block CSS
//Remove Gutenberg Block Library CSS from loading on the frontend function smartwp_remove_wp_block_library_css(){ wp_dequeue_style( ‘wp-block-library’ ); wp_dequeue_style( ‘wp-block-library-theme’ ); } add_action( ‘wp_enqueue_scripts’, ‘smartwp_remove_wp_block_library_css’ );Continue reading
Upcoming Events Custom Shortcode [upcoming_events] (The Events Calendar)
function g9_upcoming_events($atts) { $shortcode_args = shortcode_atts(array( ‘number’ => 3, // Number of events ‘category’ => ”, // Category slug ‘slider’ => false, ), $atts); // Ensure the global $post variable is in scope global $post; // Retrieve the next 3…Continue reading
Remove Price from Product Archive Page and Shop Page
function g9_remove_price($price) { if (is_shop() || is_product_category()) return; return $price; } add_filter(‘woocommerce_get_price_html’, ‘g9_remove_price’);Continue reading
Add WooCommerce Support to the Child Theme
function g9_add_woocommerce_support() { add_theme_support(‘woocommerce’); } add_action(‘after_setup_theme’, ‘g9_add_woocommerce_support’);Continue reading
Enable ACF Theme Options Page
if (function_exists(‘acf_add_options_page’)) { acf_add_options_page(array( ‘page_title’ => ‘Theme General Settings’, ‘menu_title’ => ‘Theme Settings’, ‘menu_slug’ => ‘theme-general-settings’, ‘capability’ => ‘edit_posts’, ‘redirect’ => false )); }Continue reading