Skip to content

Instantly share code, notes, and snippets.

View mitchellkrogza's full-sized avatar
🤓
Busy ... Always busy

Mitchell Krog mitchellkrogza

🤓
Busy ... Always busy
View GitHub Profile
@mitchellkrogza
mitchellkrogza / flatsome-disable-navigation-thumbnails
Created February 21, 2022 09:57
Flatsome Theme - Disable Product Navigation Thumbnails
if(!function_exists('flatsome_next_post_link_product')) {
function flatsome_next_post_link_product() {
global $post;
$next_post = get_next_post(true,'','product_cat');
if ( is_a( $next_post , 'WP_Post' ) ) { ?>
<li class="prod-dropdown has-dropdown">
<a href="<?php echo get_the_permalink( $next_post->ID ); ?>" title="View Previous Product" rel="next" class="button icon is-outline circle">
<?php echo get_flatsome_icon('icon-angle-left'); ?>
</a>
</li>
@mitchellkrogza
mitchellkrogza / flatsome-accordion-icon
Last active April 25, 2024 03:58
Flatsome Change Accordion Arrow to + sign
/*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:"+";}
@mitchellkrogza
mitchellkrogza / Remove-unnecessary-wordpress-image-sizes
Last active October 6, 2021 13:06
Remove unnecessary wordpress image sizes
/*
* 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)
});
@mitchellkrogza
mitchellkrogza / Fix-slow-wordpress-editor
Created October 4, 2021 04:38
FIX Slow WordPress Editor
// 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
*/
@mitchellkrogza
mitchellkrogza / flatsome-fix-gallery-thumbnail-sizes
Created September 26, 2021 08:44
Flatsome Theme - FIX Google Properly Size Images Warning for Gallery Thumbnails
@mitchellkrogza
mitchellkrogza / woocommerce-login-logout-redirects.php
Last active September 30, 2021 11:02 — forked from gbot/woocommerce-login-logout-redirects.php
WP: Redirect to home page for WooCommerce login logout and registration
/*----------------------------------------------------------------------------*/
// redirects for login / logout / registration
/*----------------------------------------------------------------------------*/
// Redirect after login
add_filter('woocommerce_login_redirect', 'login_redirect');
function login_redirect($redirect_to) {
return home_url();
@mitchellkrogza
mitchellkrogza / sysctl-proxmox-tune.conf
Created September 25, 2021 13:49 — forked from sergey-dryabzhinsky/sysctl-proxmox-tune.conf
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
#
### NETWORK ###
@mitchellkrogza
mitchellkrogza / google-pagespeed-fix-does-not-use-passive-event-listeners
Last active October 5, 2021 09:41
Google Pagespeed FIX does not use passive event listeners warning
// Passive event listeners
// Add this to your own custom.js file < YOU NEED TO CREATE THIS FILE YOURSELF
// Call the file in your body using
// <script src="https://mydomain.com/wp-content/themes/my-child-theme/inc/js/custom.js" ></script>
jQuery.event.special.touchstart={setup:function( _, ns, handle ){this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });}};
jQuery.event.special.touchmove={setup:function( _, ns, handle ){this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") });}};
@mitchellkrogza
mitchellkrogza / woocommerce-remove-nofollow
Created September 14, 2021 11:31
Woocommerce remove rel="nofollow" from add to cart and select options buttons
/**
* Remove "nofollow" from add to cart / Select options buttons
* What possessed Woocommerce to inplement this we shall never know ?
*/
add_filter( 'woocommerce_loop_add_to_cart_args', 'add_to_cart_args_remove_nofollow' );
function add_to_cart_args_remove_nofollow( $args ) {
unset($args['attributes']['rel']);
return $args;
@mitchellkrogza
mitchellkrogza / woocommerce-hide-featured-image
Last active September 2, 2021 09:43
Woocommerce Hide Featured Image from Specific Category