Skip to content

Instantly share code, notes, and snippets.

View jancbeck's full-sized avatar

Jan Beck jancbeck

View GitHub Profile
@jancbeck
jancbeck / woocommerce-optimize-scripts.php
Last active June 8, 2016 10:50 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
<?php add_action( 'wp_enqueue_scripts', function() {
if ( function_exists( 'is_woocommerce' ) && ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
wp_dequeue_style( 'woocommerce_frontend_styles' );
wp_dequeue_style( 'woocommerce_fancybox_styles' );
wp_dequeue_style( 'woocommerce_chosen_styles' );
wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
wp_dequeue_script( 'wc_price_slider' );
wp_dequeue_script( 'wc-single-product' );
wp_dequeue_script( 'wc-add-to-cart' );
@jancbeck
jancbeck / kirbytext.extended.php
Last active August 29, 2015 13:57 — forked from tysongach/kirbytext.extended.php
A Kirbytext extension that lets you add HTML5 figure tags for videos and images.
<?php
class kirbytextExtended extends kirbytext {
function __construct($text=false, $markdown=true, $smartypants=true) {
parent::__construct($text, $markdown, $smartypants);
// define custom tags
$this->addTags('figure');