Skip to content

Instantly share code, notes, and snippets.

View ellegaarddk's full-sized avatar

ellegaarddk ellegaarddk

View GitHub Profile
@ellegaarddk
ellegaarddk / functions.php
Created December 15, 2017 11:35
Tilføjer 'Udsolgt label til WooCommerce
// Adds 'Udsolgt' label to produkts out of stock
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_stock', 10);
function woocommerce_template_loop_stock() {
global $product;
if ( ! $product->managing_stock() && ! $product->is_in_stock() )
echo '<p class="stock out-of-stock">Udsolgt</p>';
}
@ellegaarddk
ellegaarddk / remove-metainfo-on-posts.php
Last active May 29, 2017 07:30
Wordpress Genesis - change / remove meta info pon posts
<?php
/** Customise the post-info function */
add_filter( 'genesis_post_info', 'genesischild_post_info' );
function genesischild_post_info($post_info) {
if (!is_page()) {
$post_info = 'Posted on [post_date] Written by [post_author] [post_comments] [post_edit]'; //Edit to relevant text
//$post_info = ''; //To remove text
return $post_info;
}
}
@ellegaarddk
ellegaarddk / optimized.htaccess
Last active June 22, 2019 09:03
Optimised htaccess for WP - expires, headers and deflate
# Optimized expire cache and compression
# For WordPress
# by ellegaard ID
# Insert above default WP section in .htaccess - use with caution!
# BEGIN Manual editing for speed
## BEGIN Expire headers
<ifModule mod_expires.c>
AddType application/font-sfnt otf ttf
AddType application/font-woff woff