Skip to content

Instantly share code, notes, and snippets.

View sirchrispy's full-sized avatar
🤔
Just doing my thing.

Chris Power sirchrispy

🤔
Just doing my thing.
View GitHub Profile
add_filter('use_block_editor_for_post', '__return_false');
@andrasguseo
andrasguseo / delete-events-before-import.php
Last active October 22, 2020 03:46
Event Aggregator - delete events before import
<?php
/**
* Created by PhpStorm.
* Plugin Name: Berean Baptist Church Calendar Import Fixer
* Description: Forces removal of events no longer represented in the imported calendar.
* Version: 0.0.1
* Author: Steve Dwire for Berean Baptist Church
* Author URI: https://www.berean-baptist.org/
* License: GPLv2
*/
@jtsternberg
jtsternberg / wpcli-flywheel-cache-flush.php
Last active July 26, 2021 14:03
Flush cache on Flywheel Local VM
<?php
function handle_remote_cache_requests_for_local() {
global $_wp_using_ext_object_cache;
if (
empty( $_wp_using_ext_object_cache )
|| ! isset( $_REQUEST['check'], $_REQUEST['command'] )
|| ! function_exists( 'wp_cache_' . $_REQUEST['command'] )
|| str_replace( ABSPATH, '', __FILE__ ) !== $_REQUEST['check']
) {
@andrasguseo
andrasguseo / modify-imported-event-timezones.php
Last active November 1, 2019 21:51
Modify timezone and time when importing with EA (The Events Calendar)
<?php
/*
* Description: Modifies the timezone and the time of imported events, if the source
* feed timezone is UTC
*
* Usage: Copy the snippet into your theme's (preferably child theme's) functions.php file.
* Modify the URL and the timezone at the end of the code based on your needs
* Timzone name list: the TZ* column on this page
* https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
*
@butlerblog
butlerblog / functions.php
Last active March 28, 2024 02:09
SMTP using wp-config.php for settings #smtp #wp_mail
<?php // Don't use this line.
/*
* Add the script below to wherever you store custom code snippets
* in your site, whether that's your child theme's functions.php,
* a custom plugin file, or through a code snippet plugin.
*/
/**
* This function will connect wp_mail to your authenticated
@srikat
srikat / class-custom-featured-post.php
Last active April 3, 2022 16:29 — forked from GaryJones/readme.md
Custom Featured Posts Widget plugin: Skeleton for amending the output of the Genesis Featured Posts widget. https://sridharkatakam.com/custom-featured-post-widget-plugin/
<?php
/**
* Plugin Name
*
* @package Custom_Featured_Post_Widget
* @author Gary Jones
* @license GPL-2.0+
* @link http://gamajo.com/
* @copyright 2013 Gary Jones, Gamajo Tech
*/
@amitramani
amitramani / functions.php
Last active February 9, 2018 22:49
How to get Crawler Based Search Engine for Swiftype on WordPress using Genesis
// October 11, 2015 Change search form text from https://wpbeaches.com/change-search-field-default-text-genesis-wordpress-theme/
function themeprefix_search_button_text( $text ) {
return ( 'Start Typing...');
}
add_filter( 'genesis_search_text', 'themeprefix_search_button_text' );
function b3m_search_form( $form, $search_text, $button_text, $label ) {
$onfocus = " onfocus=\"if (this.value == '$search_text') {this.value = '';}\"";
$onblur = " onblur=\"if (this.value == '') {this.value = '$search_text';}\"";
@kaishin-r
kaishin-r / sublime-text-3-cloud-drive-sync
Created February 19, 2016 09:48
Sync Sublime Text 3 Settings via iCloud Drive
# Create a directory named "Sublime Text 3 Sync" under iCloud Drive
mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync
# Enter Sublime Text 3's directory
cd ~/Library/Application\ Support/Sublime\ Text\ 3/
# Move "Installed Packages" directory to iCloud Drive and make a link
mv Installed\ Packages/ ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/Installed\ Packages
@bryanwillis
bryanwillis / debug-atts.php
Last active July 29, 2019 23:52
This allows you to debug all of the known genesis attributes available for filtering. Genesis attributes are used for adding classes, schema.org markup, id's, and any other html attributes to elements. Drop this in your functions.php
<?php
/**
* Debug Genesis Attributes
* @author Bryan Willis
*/
add_action( 'wp_footer', 'debug_genesis_attr_filters' );
function debug_genesis_attr_filters()
{
global $wp_filter; // current_filter() might be a better way to do this
$genesis_attr_filters = array ();
@lewismcarey
lewismcarey / SassMeister-input.scss
Last active May 4, 2023 12:10
Get Color from SASS Color Map
// ----
// libsass (v3.2.5)
// ----
// Color Map
$colors: (
blue: #0000FF,
red: (
base: #FF0000,
light: #EEEEFF,