Select Page

Function to disable comments in WordPress

// Disable comments on all post types function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types as $post_type) { if(post_type_supports($post_type, ‘comments’)) { remove_post_type_support($post_type, ‘comments’);…

Function to remove Divi Projects in WordPress

add_filter( ‘et_project_posttype_args’, ‘mytheme_et_project_posttype_args’, 10, 1 ); function mytheme_et_project_posttype_args( $args ) { return array_merge( $args, array( ‘public’ => false, ‘exclude_from_search’ => false, ‘publicly_queryable’ => false,…

Show remaining cost on WooCommerce site to get free shipping

Add this to the functions.php file and then add the shortcode of [shippingleft] to get it to show up. function how_much_shipping_is_left() { $min_amount = 100; //change this to your free shipping threshold $current = WC()->cart->subtotal; if ( $current <…

WooCommerce hide Klarna payment method if order total is under £35

Add this to the functions.php to hide Klarna payment method if the order total is under £35 //hide klarna if order total is under £35 add_filter( ‘woocommerce_available_payment_gateways’, ‘rudr_turn_off_cod’ ); function rudr_turn_off_cod( $available_gateways ) { if(…

Output additional image sizes on the frontend of WordPress

Use this to find all the additional image sizes your site is using /* Output all image sizes on the frontend —————————————————————————————————- */ add_action(‘init’, ‘get_all_image_sizes’); function…

Disable Divi Custom Post Type CSS file

Add this to your functions files to disable/remove the Divi CPT CSS file from being used. /* Disable Divi CPT CSS */ function disable_cptdivi() { remove_action( ‘wp_enqueue_scripts’, ‘et_divi_replace_stylesheet’, 99999998 ); } add_action(‘init’, ‘disable_cptdivi’);…

Archives