View woocommerce-wcfm-marketplace-notify-user-product-deletion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ====================================================================================== | |
// Notify user of product deletion | |
// Applies to any Woocommerce product but was written specifically for WCFM Marketplace | |
// Copyright Bjorn Patje & Mitchell Krog (thank you Bjorn) | |
// ====================================================================================== | |
// This sends an email to the owner (user) of a product when it is deleted / trashed | |
// The email uses simple html formatting and php variables | |
// Modify the contents of the $body varaible and $subject variable to your liking | |
// ====================================================================================== | |
add_action( 'delete_post', 'notification_for_product', 99 ); |
View flatsome-theme-change-product-titles-to-h2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Flatsome Theme | |
* Change Shop & Catalog Product Titles from <p> to <h2> | |
* Adjust to <h3> <h4> <h5> <h6> as you require. | |
*/ | |
if ( ! function_exists( 'woocommerce_template_loop_product_title' ) ) { | |
function woocommerce_template_loop_product_title() { | |
echo '<h2 class="name product-title ' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '">'; | |
woocommerce_template_loop_product_link_open(); |
View woocommerce-change-backorder-message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CHANGE WOOCOMMERCE BACKORDER TEXT | |
// Here I have used a 3 line message with inline styles to change the color and add line breaks | |
// Adapt this as you see fit | |
// Use Code Snippets Plugin to add this function or add yourself to functions.php of your child theme | |
// https://wordpress.org/plugins/code-snippets/ | |
function mywoo_backorder_message( $text, $product ){ | |
if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { | |
$text = __( '<strong><p style="color:green">New Stock is on its way !!!!<br>Backorder now - first come first served<br>Please allow 1 – 3 weeks for delivery of this item</p></strong><br>', 'your-textdomain' ); | |
} |
View flatsome-accordion-icon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*ACCORDIAN*/ | |
/* Change the Flatsome default accordion Arrow Icon to a + symbol*/ | |
.accordion-title.active{background-color:#006587!important;color:white!important} | |
.accordion-inner{background-color:#eeeeee!important} | |
.accordion-title{font-size:100%} | |
.accordion-inner{padding:10px;font-size:.85em} | |
.accordion .toggle{top:3px!important;transform-origin: 50% 50%!important;} | |
.accordion .active .toggle{top:3px!important;} | |
.accordion-item {margin-bottom: 8px;} | |
.accordion .icon-angle-down:before{content:"+";} |
View Remove-unnecessary-wordpress-image-sizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* WordPress: Remove unwanted image sizes. | |
* Remove the three sizes medium_large, 1536x1536, 2048x2048 | |
* Not needed for 99% of Woocommerce stores | |
*/ | |
add_filter('intermediate_image_sizes', function($sizes) { | |
return array_diff($sizes, ['medium_large']); // Medium Large (768 x 0) | |
}); |
View Fix-slow-wordpress-editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A fix for the horribly slow WordPress post and product editor | |
// With many thanks to Jon Brown | |
// Read about it at https://9seeds.com/wordpress-admin-post-editor-performance/ | |
/** | |
* Remove Ancient Custom Fields metabox from post editor | |
* because it uses a very slow query meta_key sort query | |
* so on sites with large postmeta tables it is super slow | |
* and is rarely useful anymore on any site | |
*/ |
View flatsome-fix-gallery-thumbnail-sizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This fixes the Google Pagespeed Insights warning for "Properly Size Images" | |
// First inspect your gallery thumbnails with chrome developer tools and find the size they are RENDERED at on DESKTOP | |
// In my case they render at exactly 165 x 110 | |
// This function creates the correct gallery thumbnail size for Woocommerce and does NOT affect any image sizes of Flatsome | |
// After adding this function (use Code Snippets plugin) You need to Regenerate Thumbnails | |
// Use the plugin "Renegrate thumbmnails" with the setting "Skip regenerating existing correctly sized thumbnails (faster)." | |
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) { | |
return array( |
NewerOlder