Skip to content

Instantly share code, notes, and snippets.

View Kyzoe's full-sized avatar
💭
I am be slow to respond. Contact me at Kyzoe.be

Kyzoe

💭
I am be slow to respond. Contact me at Kyzoe.be
View GitHub Profile
@Kyzoe
Kyzoe / functions.php
Created March 21, 2020 14:33
bepaal de lokatie van een bezoeker op de frontpage van je mylisting irectory.
function location_javascript() {
if (is_front_page()) {
?>
<script>
(function ($) {
$(document).ready(function(){
setTimeout(function() {
$(".geocode-location").trigger('click');
},10);
});
// WP - LIMIT IMAGE UPLOAD SIZE
function max_image_size( $file ) {
$size = $file['size'];
$size = $size / 1024;
$type = $file['type'];
$is_image = strpos( $type, 'image' ) !== false;
$limit = 850;
$limit_output = '850KB';
if ( $is_image && $size > $limit ) {
$file['error'] = 'Image files must be smaller than ' . $limit_output;
@Kyzoe
Kyzoe / Free instead of 0.00
Created February 28, 2020 17:19
[Snippet WOO] Display Free instead of 0.00 in Woocommerce
/**
* @snippet Display FREE if Price Zero or Empty - WooCommerce Single Product
* @how-to add to functions.php in your childtheme
* @author Peter Kuipers
* @testedwith WooCommerce 3.9
* @Change free in line 13 to whatever you want to show instead of the value 0.00
*/
add_filter( 'woocommerce_get_price_html', 'kyzoe_price_free_zero_empty', 9999, 2 );
@Kyzoe
Kyzoe / WooCommerce: Is this a gift + Validation + Email + Order Details
Created May 1, 2019 13:42
WooCommerce: Is this a gift + Validation + Email + Order Details
// add gift message on checkout after the "Order Notes"
add_action( 'woocommerce_after_order_notes', 'bdev_is_this_a_gift' );
function bdev_is_this_a_gift() {
$domain = 'woocommerce';
?>
<style>p#gift_field{display:none;}</style>
<div id="message">
<h3><i class="fa fa-gift"></i><?php _e( ' Is this a gift?', 'woocommerce' ); ?></h3>
<?php