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 / text-widget-shortcodes.php
Last active August 29, 2015 14:07
Enable Shortcode for Text Widgets in WordPress.
<?php
/** Do NOT include the opening php tag */
add_action( 'init', 'ddw_add_shortcodes_for_text_widget', 1 );
/**
* Enable Shortcodes for Text Widgets.
*
* @author David Decker - DECKERWEB
@deckerweb
deckerweb / cpi-snippets.php
Last active August 29, 2015 14:07
Cleaner Plugin Installer plugin v1.0.0 or higher -- helper functions, plus actions, filters for customizing etc.
<?php
/** Do NOT include the opening php tag */
/**
* Plugin: Cleaner Plugin Installer - activate Slim Mode.
*/
if ( ! defined( 'CPI_SLIM_MODE' ) ) {
define( 'CPI_SLIM_MODE', TRUE );
}
<?php
/*
* @goliver79
* woocommerce hide empty categories in woocommerce widget "product categories"
*/
function woo_hide_product_categories_widget( $list_args ){
$list_args[ 'hide_empty' ] = 1;
return $list_args;
}
<?php
/*
* Add custom query vars to handle Google Analytics Ecommerce tracking.
* This should be placed in a plugin or in functions.php of the theme.
*
* You'll want to use the redirect method for Gravity Forms confirmations and
* turn on passing field data via a query string. An example we used was:
* donation_amount={Donation Amount:13}&donation_id={entry_id}&donation_recurring=0
*/
function sm_add_query_vars( $vars ){
@deckerweb
deckerweb / dlm-pa-search-args.php
Created May 13, 2015 08:39
Download Monitor - tweak search args for Page Add-On --- status here: testing - don't use yet!!! ;-)
<?php
add_filter( 'dlm_page_addon_search_query_args', 'ddw_dlm_search_args' );
/**
* Plugin: Download Monitor
* Tweak Downloads search args
*/
function ddw_dlm_search_args( $args ) {
$args[ 'tax_query' ] = array(
@deckerweb
deckerweb / genesis-layout-extras.php
Created November 9, 2011 19:38
Genesis Layout Extras Plugin 1.3-alpha -- For Genesis 1.8 and new Admin Classes
<?php
/**
* Main plugin file. This plugin for Genesis Theme Framework allows modifying of default layouts for
* homepage, singular, archive, attachment, search, 404 and even bbPress 2.x pages via Genesis theme settings.
*
* @package GenesisLayoutExtras
* @author David Decker
* @origin Based on the work of @WPChildThemes for original plugin called "Genesis Layout Manager" (C) 2010
*
* Plugin Name: Genesis Layout Extras
@deckerweb
deckerweb / gist:1574576
Created January 7, 2012 12:01
Plugin: WP Single Post Navigation -- Customize parameters for "next post link" -- add this to functions.php of your theme or child theme
<?php
add_filter( 'wpspn_next_post_link', 'custom_wpspn_next_link' );
/**
* WP Single Post Navigation: Add custom filters for "next post link"
*/
function custom_wpspn_next_link() {
$args = array (
'format' => '%link', // Change link format
@deckerweb
deckerweb / gist:1574571
Created January 7, 2012 11:59
Plugin: WP Single Post Navigation -- Customize parameters for "previous post link" -- add this to functions.php of your theme or child theme
<?php
add_filter( 'wpspn_previous_post_link', 'custom_wpspn_previous_link' );
/**
* WP Single Post Navigation: Add custom filters for "previous post link"
*/
function custom_wpspn_previous_link() {
$args = array (
'format' => '%link', // Change link format
@deckerweb
deckerweb / gist:1576197
Created January 7, 2012 22:02
Plugin: Genesis Single Post Navigation -- Customize parameters for "previous post link" -- add this to functions.php of your child theme
<?php
add_filter( 'gspn_previous_post_link', 'custom_gspn_previous_link' );
/**
* Genesis Single Post Navigation: Add custom filters for "previous post link"
*/
function custom_gspn_previous_link() {
$args = array (
'format' => '%link', // Change link format (default: %link)
@deckerweb
deckerweb / gist:1576203
Created January 7, 2012 22:03
Plugin: Genesis Single Post Navigation -- Customize parameters for "next post link" -- add this to functions.php of your child theme
<?php
add_filter( 'gspn_next_post_link', 'custom_gspn_next_link' );
/**
* Genesis Single Post Navigation: Add custom filters for "next post link"
*/
function custom_gspn_next_link() {
$args = array (
'format' => '%link', // Change link format (default: %link)