Skip to content

Instantly share code, notes, and snippets.

@mikezielonka
mikezielonka / web-stories-auto-analytics.php
Last active May 28, 2023 17:18 — forked from swissspidy/web-stories-auto-analytics.php
Mini-plugin to add an additional Google Analytics tracking code to web stories
/**
* Plugin Name: Web Stories Additional GA Tracking
* Description: Mini-plugin to add an additional Google Analytics tracking code to web stories
* Plugin URI: https://wp.stories.google/
* Author: Pascal Birchler, Google
* Author URI: https://opensource.google.com/
* Version: 0.0.1
* License: Apache License 2.0
* License URI: https://www.apache.org/licenses/LICENSE-2.0
@mikezielonka
mikezielonka / wp-rocket-prefetch-dns-short.txt
Last active August 11, 2020 21:23
WP Rocket Prefetch DNS Short List
//0.gravatar.com
//1.gravatar.com
//2.gravatar.com
//a.optmnstr.com
//ajax.googleapis.com
//ajax.microsoft.com
//api.pinterest.com
//apis.google.com
//cdnjs.cloudflare.com
//code.jquery.com
@mikezielonka
mikezielonka / wp-rocket-prefetch-dns.txt
Last active June 11, 2020 02:03
List of urls to DNS prefetch when using WP-Rocket on Wordpress.
//0.gravatar.com
//1.bp.blogspot.com
//1.gravatar.com
//2.bp.blogspot.com
//2.gravatar.com
//3.bp.blogspot.com
//4.bp.blogspot.com
//a.optmnstr.com
//ad.doubleclick.net
//adservice.google.com
@mikezielonka
mikezielonka / filter-rss-images-out.php
Last active August 29, 2015 14:22
Filter Images Out of RSS Feeds in WordPress
<?php
/*
Plugin Name: Filter Images Out of RSS Feeds
Description: Filters images out of the content in rss feeds.
Version: 0.1-alpha
Author: Tuna Traffic
Author URI: http://tunatraffic.com
*/
add_filter( 'the_content', 'rss_filter_img' );
@mikezielonka
mikezielonka / full-width-genesis.php
Created May 15, 2015 04:39
force full width for woocommerce when using Genesis WordPress Themes
/**
* WooCommerce Layout
*/
//check if woo is active
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
function site_woo_layout() {
//apply full width to all woo pages
if( is_woocommerce() ) {
return 'full-width-content';
}
<?php
function remove_post_thumbnail($metadata, $object_id, $meta_key, $single){
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() )
return false;
else
return $metadata;
}
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4);
@mikezielonka
mikezielonka / gist:7538197
Created November 19, 2013 00:47
Get WordPress To Play Nice When Your Entire WP-Content Directory is a SymLink aka Symbolic Link
/*Get WordPress To Play Nice When Your Entire WP-Content Directory is a SymLink aka Symbolic Link*/
define('WP_CONTENT_DIR', realpath($_SERVER['DOCUMENT_ROOT'] . '/wp-content'));
@mikezielonka
mikezielonka / wp-content-plugin-dir.php
Last active December 27, 2015 12:59
Define WordPress Plugin Directory in wp-config.php
/*Get WordPress To Play Nice When Your Entire Plugin Directory is a SymLink aka Symbolic Link*/
define('WP_PLUGIN_DIR', realpath($_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins'));