Skip to content

Instantly share code, notes, and snippets.

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

David Decker deckerweb

🏠
Working from home
View GitHub Profile
@deckerweb
deckerweb / gfpe-snippets.php
Created January 19, 2014 22:04
Genesis Featured Page Extras plugin v1.0.0 or higher -- helper functions, plus filters for customizing and branding
<?php
/** Do NOT include the opening php tag */
/** Genesis Featured Page Extras: Remove Widgets Shortcode Support */
add_filter( 'gfpe_filter_widget_shortcodes', '__return_false' );
<?php
add_filter( 'genesis_single_crumb', 'gj_single_crumb', 10, 2 );
/**
* Remove Post Title from Breadcrumb.
*
* Takes a substring of crumb, starting at 0, with a length of up to the last occurrence of the
* (start of the) separator string.
*/
function gj_single_crumb( $crumb, $args ) {
<?php
function response_time() {
echo "<script>
window.addEventListener(
'load',
function() {
setTimeout(
function() {
if ( window.performance && window.performance.timing && window.console ) {
@deckerweb
deckerweb / load-custom-translations-example.php
Last active January 2, 2016 05:58
DE: Plugin "Load Custom Translations" (Eigene Übersetzungen laden) - Beispiel-Code für Ihr Functionality- oder Drittanbieter-Plugin, oder für Schnipselverwaltung "Code Snippets" oder "Toolbox" Plugin, oder eben für die "functions.php" Datei Ihres Themes bzw. Child Themes. ----- // ----- EN: Load Custom Translations plugin - example code for your…
<?php
/**
* Add custom translations via plugin "Load Custom Translations" by DECKERWEB
*/
if ( defined( 'LCTRL_PLUGIN_BASEDIR' ) ) :
lct_load_custom_translations(
array(
@deckerweb
deckerweb / custom-jetpack-de.php
Created December 15, 2013 18:25
Mini-Zusatz-Plugin für "Jetpack Deutsch (de_DE)": Benutzerdefinierte Filter für das Plugin "Jetpack German (de_DE)".
<?php
/**
* @package Custom Jetpack German (de_DE)
* @author David Decker
* @copyright Copyright (c) 2013, David Decker - DECKERWEB
* @license GPL-2.0+
* @link http://deckerweb.de/twitter
*
* @wordpress-plugin
* Plugin Name: Custom Jetpack German (de_DE)
@deckerweb
deckerweb / wcde-remove-gettext-filters.php
Created December 1, 2013 16:36
WCDE: Remove Gettext filters
<?php
/** Do NOT include the opening php tag */
/**
* Remove gettext filters of WCDE.
*
* @author David Decker - DECKERWEB
* @link http://deckerweb.de/twitter
*/
remove_filter( 'gettext', 'ddw_wcde_gettext_read_accept_string', 10, 4 );
@deckerweb
deckerweb / genesis-google-authorship-single-page.php
Last active December 28, 2015 19:29
In Genesis Framework load other Google Authorship than the default - only for a specific page (or an array of pages or whatever...)
<?php
/** Do NOT include the opening php tag */
add_action( 'wp_head', 'ddw_tweak_google_rel_author', 5 );
/**
* Remove default Google Plus author URL and re-add another specific one - for a specific page only.
*
* @author David Decker - DECKERWEB
* @link http://deckerweb.de/twitter
@deckerweb
deckerweb / 0_reuse_code.js
Created November 15, 2013 18:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@deckerweb
deckerweb / wpml-remove-wcde-gettext-filters.php
Created November 1, 2013 18:55
Entfernt Gettext Filter in "WooCommerce German (de_DE)" Plugin wenn WPML-Sprache NICHT deutsch ist! // Removes gettext filters in "WooCommerce German (de_DE)" plugin for all non-German locales.
<?php
/** Do NOT include the opening php tag */
/**
* Remove gettext filters of WCDE, for non-German locales when using WPML.
*
* @author David Decker - DECKERWEB
* @link http://deckerweb.de/twitter
*/
if ( defined( 'ICL_LANGUAGE_CODE' ) && ! ( ICL_LANGUAGE_CODE == 'de' ) ) {