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 / btc-tweak-remove-integration.php
Last active August 17, 2018 11:12
Plugin: Builder Template Categories - Code Snippet for removing an integration:
<?php
/** Do NOT include the opening php tag */
add_action( 'init', 'btc_tweak_remove_integration' );
/**
* Plugin: Builder Template Categories - Remove one or more integrations.
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/07416fe610ed992650cbadfb77c5ee74
@deckerweb
deckerweb / btc-filter-capability.php
Last active August 17, 2018 11:12
Plugin: Builder Template Categories - Code Snippet for filtering the capability for the plugin:
<?php
/** Do NOT include the opening php tag */
add_filter( 'btc/filter/capability/submenu', 'btc_custom_capability_submenu' );
/**
* Plugin: Builder Template Categories - Custom capability.
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/89f5f8d2b8d31073401a80ef6d0f10dc
@deckerweb
deckerweb / btc-add-new-integration.php
Last active January 21, 2019 21:39
Plugin: Builder Template Categories - Code Snippet for adding a new integration:
<?php
/** Do NOT include the opening php tag */
add_filter( 'btc/filter/integrations/all', 'btc_register_custom_integration' );
/**
* Plugin: Builder Template Categories - Register custom integration.
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/cae6d2703400601e2e78be3a27e93cfb
@deckerweb
deckerweb / gist:d03269e18c567d153251e39cb9b5072d
Created August 6, 2018 14:59 — forked from israelcurtis/gist:3798347
Use the get_post_field() function to get any of the wp_posts column fields #wordpress #php
<?php
echo get_post_field('post_content', $post_id); // retrieve content
echo get_post_field('post_name', $post_id); // retrieve the slug
?>
@deckerweb
deckerweb / facetwp-pagination-genesis-markup.php
Created July 27, 2018 09:03 — forked from JiveDig/facetwp-pagination-genesis-markup.php
Adjust FacetWP's pager html to match Genesis markup. This allows it to inherit the Genesis theme styles. Used with [facetwp pager="true"]
<?php
/**
* Style pagination to look like Genesis.
*
* @version 1.0.0
*
* @author Mike Hemberger @JiveDig
*
* @link https://halfelf.org/2017/facetwp-genesis-pagination/
@deckerweb
deckerweb / functions.php
Created June 1, 2018 12:24 — forked from leepettijohn/functions.php
Add Event to The Events Calendar from a Gravity Form
//The following section is an add-on to this tutorial - https://tri.be/gravity-forms-events-calendar-submissions/
//Shout to CreativeSlice.com for their initial work
/* Before Starting:
- Make sure you have these three plugins installed
- Gravity Forms
- The Events Calendar
- Gravity Forms + Custom Post Types
- Once Gravity Forms is installed, create a form with these fields
- Single Line Text (Event Title)
- Paragraph Text (Event Description)
@deckerweb
deckerweb / astra-disable-google-fonts.php
Last active January 4, 2022 04:19
Astra Theme - disable Google Fonts
<?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 / astra-remove-category-sidebar.php
Last active March 10, 2023 11:22
Conditionally remove sidebar from category archives for Astra Theme
<?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 / auto-dark-mode.php
Created April 19, 2018 20:59
Lets you enable Dark Mode automatically between certain times. Requires Dark Mode plugin version 2.0 or later.
<?php
/**
* Plugin Name: Automatic Dark Mode
* Plugin URI: https://github.com/danieltj27/Dark-Mode/
* Description: Lets your users make the WordPress admin dashboard darker.
* Author: Daniel James
* Author URI: https://www.danieltj.co.uk/
* Text Domain: auto-dark-mode
* Version: 1.0
@deckerweb
deckerweb / genesis-open-graph.php
Created April 19, 2018 15:02 — forked from bradonomics/genesis-open-graph.php
Adding Open Graph Meta Tags to the Genesis Theme Head
<?php
//* Call the First Image in a Post (Used in the Open Graph Call Below)
function catch_first_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];