Skip to content

Instantly share code, notes, and snippets.

View Auke1810's full-sized avatar
🏠
Working from home

Auke Jongbloed Auke1810

🏠
Working from home
View GitHub Profile
@Auke1810
Auke1810 / buttons_fullwidth.php
Last active September 1, 2018 07:28
Enfold full width button with event tracking
<?php
/**
* Button
* Displays a button that links to any url of your choice
* Gives a extra field in settings where you can give a Google Events label (line 89).
* When the button is clicked you will find a Event category UX with Action click and the label you have provided.
*/
if ( !class_exists( 'avia_sc_button_full' ) )
{
@Auke1810
Auke1810 / functions-performance-php
Last active June 6, 2021 12:59
Wordpress performance snippets for functions.php
################# performance snippets ###########################################
/**
* decrease jpeg quality to 80
*/
add_filter( 'jpeg_quality', create_function( '', 'return 80;' ) );
/**
* Disable the emoji's
*/
@Auke1810
Auke1810 / WP_HTML_Compression
Created November 12, 2016 10:58
html minify snippet class for wordpress.
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
protected $html;
public function __construct($html) {
if (!empty($html)) {
$this->parseHTML($html);
@Auke1810
Auke1810 / yoast-seo-aanpassingen-functions.php
Last active September 1, 2018 07:20
Custom aanpassingen aan yoast seo meta robot tag en canonical tag tbv technische optimalisatie van wordpress woocommerce webshop
################# SEO Aanpassingen ###########################################
# https://gist.github.com/Auke1810/9939b52131bdb2af819143798aba60f2
##############################################################################
/**
* add_noindex_tags
* meta robots tag vullen met de juiste instelling per pagina type
* Gepagineerde pagina’s (zonder parameters) moeten index, follow zijn.
* Gepagineerde pagina’s met parameters mogen een noindex, nofollow
*/
@Auke1810
Auke1810 / admin-functions.php
Last active September 1, 2018 07:20
shelflife/functions/admin-funcitons.php aanpassingen aan de file om de breadcrumbs microdata mee te geven voor betere indexering in Google.
<?php
// File Security Check
if ( ! defined( 'ABSPATH' ) ) exit;
?>
<?php
/*-----------------------------------------------------------------------------------
TABLE OF CONTENTS
- woo_image - Get Image from custom field
@Auke1810
Auke1810 / gist:026c62256939c970fde7851e675b9c96
Created November 30, 2016 13:01 — forked from pullmonkey/gist:783562
Comprehensive PHP VIN Decoder using VIN API
<?
// VIN API decoder for PHP 4.x+
define('ELEMENT_CONTENT_ONLY', true);
define('ELEMENT_PRESERVE_TAGS', false);
function getXML($vin) {
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, 'http://vinapi.skizmo.com/vins/'. $vin.'.xml');
curl_setopt ($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', 'X-VinApiKey: #YOURAPIKEYGOESHERE#')); //use your API key here
@Auke1810
Auke1810 / wpa-clean-header.php
Last active January 22, 2024 10:14
create a clean wordpress header and remove unnecessary clutter.
<?php
/*
Plugin Name: wordpress assist clean header
Plugin URI: http://www.wordpressassist.nl/
Description: Remove shortlink hook
Version: 1.0
Author: AukeJomm
Author URI: http://www.aukejongbloed.nl
*/
@Auke1810
Auke1810 / more_products.php
Created August 18, 2017 12:08
Te vinden in shelflife/includes/
<?php
/**
* More Products Component
*
* Display X more products.
*
* @author Matty
* @since 1.0.0
* @package WooFramework
* @subpackage Component
@Auke1810
Auke1810 / Alter feed items
Last active October 2, 2019 19:23
Example how to use the wppfm_feed_item_value filter for woocommerce product feed manager
<?php
function alter_feed_item( $attributes, $feed_id, $product_id ) {
// The $attributes variable is an array that contains all the product data that goes into the feed. Each item
// can be accessed by it's feed key. So if in the feed file an item has a key like 'description', you
// can access that specific item by $attributes['description'].
// The $feed_id (string) makes it possible to only edit a specific feed. You can find the id of a feed in the
// url of the Feed Editor, right after id=.
// The $product_id (string) makes it possible to select a specific product id that you want to filter.
@Auke1810
Auke1810 / Alter Product feed price item
Last active December 19, 2017 11:17
Use the price including tax in the price attribute for the woocommerce product feed manager
/**
* Alter Product feed item
* Use the price including tax in the price attribute
*/
function alter_feed_item( $attributes, $feed_id, $product_id ) {
global $product;
$product = wc_get_product( $product_id );
// show price including tax
$attributes['price'] = $product->get_price_including_tax() . " USD";