Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Decker deckerweb

🏠
Working from home
View GitHub Profile
@deckerweb
deckerweb / astra-remove-category-sidebar.php
Last active Jul 14, 2022
Conditionally remove sidebar from category archives for Astra Theme
View astra-remove-category-sidebar.php
<?php
/** Do NOT include the opening php tag */
add_filter( 'astra_page_layout', 'ddw_astra_conditionally_remove_category_sidebar' );
/**
* Conditionally remove sidebar in Astra
*
* @see https://codex.wordpress.org/Conditional_Tags
* @link https://gist.github.com/deckerweb/18a141ee5a7a32f056c1f720cd0a1d28
@deckerweb
deckerweb / gist:1e17c328b5f36adfecb5
Created Nov 3, 2015 — forked from ssstofff/gist:4dd1557abda08e7be90a
Gravity Forms: restrict days on datepicker
View gist:1e17c328b5f36adfecb5
jQuery(function () {
// 0 = monday, 1 = tuesday, 2 = wednesday, 3 = thursday,
// 4=friday, 5 = saturday, 6=sunday
var daysToDisable = [2, 4, 5];
jQuery("#input_id_id").datepicker({
beforeShowDay: disableSpecificWeekDays
});
@deckerweb
deckerweb / education20-home-widgetized.php
Last active Mar 2, 2022
Genesis: Education 2.0 Child Theme -- Add widget support for the Education 2.0 homepage. If no widgets active, display the default loop.
View education20-home-widgetized.php
<?php
/** Add support for widgetized home page */
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'ddw_education_home_loop_helper' );
/**
* Add widget support for the Education 2.0 homepage.
* If no widgets active, display the default loop.
*
* @author David Decker - DECKERWEB
@deckerweb
deckerweb / gist:2392882
Created Apr 15, 2012
Easy Digital Downloads Toolbar plugin v1.0+ -- filters and constants for customizing and branding
View gist:2392882
<?php
// Action hooks:
add_action( 'eddtb_custom_main_items', 'eddtb_add_custom_main_items' );
/**
* Easy Digital Downloads Toolbar: Add Custom Main Items
*/
function eddtb_add_custom_main_items() {
// Your custom stuff here, you might only use the WP Toolbar / Admin Bar API here!
@deckerweb
deckerweb / astra-disable-google-fonts.php
Last active Jan 4, 2022
Astra Theme - disable Google Fonts
View astra-disable-google-fonts.php
<?php
/** Do NOT include the opening php tag */
/**
* Do not load a list of Google Fonts in Astra
*
* @link https://gist.github.com/deckerweb/528e9f64f09b15ed4d6729b77d87dc78
* @author David Decker - DECKERWEB
*/
@deckerweb
deckerweb / wp-admin-add-posts-state.php
Created Mar 26, 2019 — forked from martijn94/wp-admin-add-posts-state.php
Snippet to add post state to a WordPress page
View wp-admin-add-posts-state.php
<?php
//======================================================================
// Add post state to the projects page
//======================================================================
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
@deckerweb
deckerweb / wc-custom-add-to-cart-texts.php
Created Jun 3, 2014
Custom text for 'woocommerce_product_add_to_cart_text' filter for all product types/ cases.
View wc-custom-add-to-cart-texts.php
<?php
/** Do NOT include the opening php tag */
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/**
* Custom text for 'woocommerce_product_add_to_cart_text' filter for all product types/ cases.
*
* @link https://gist.github.com/deckerweb/cf466e017fd01d503469
View elementor-form-additional-webhook.php
<?php
/**
* Plugin Name: Elementor Form Additional Webhook
* Plugin URI: https://coreysalzano.com/
* Description: Adds a second Webhook to the Lot Wizard trial signup form
* Version: 1.0.0
* Author: Corey Salzano
* Author URI: https://github.com/mistercorey
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@deckerweb
deckerweb / gist:b7e70a52ed76b6486795
Last active Aug 8, 2021
WordPress Forms plugin comparison table - by David Decker (@deckerweb) of deckerweb.de
View gist:b7e70a52ed76b6486795
@deckerweb
deckerweb / unload-elementor-textdomain.php
Last active Aug 1, 2021
Unload Elementor Textdomain -- below Code Snippet should go into "Code Snippets" plugin at best (please avoid functions.php or similar hacks)!
View unload-elementor-textdomain.php
<?php
/** Do NOT include the opening php tag */
add_action( 'plugins_loaded', 'ddw_unload_elementor_textdomain' );
/**
* Unload Textdomain for "Elementor" and "Elementor Pro" plugins.
* (Comment functions out for those not wanted to unload.)
*
* @author David Decker - DECKERWEB