Skip to content

Instantly share code, notes, and snippets.

@patric-boehner
patric-boehner / sitemap.php
Created May 25, 2018 00:17
Filter the genesis sitemap function to remove authors, tags and add support for custom post types
<? php
// Don't include opening php
// Sitemap Output
add_filter( 'genesis_sitemap_output', 'pb_customize_sitemap_output' );
function pb_customize_sitemap_output() {
$heading = ( genesis_a11y( 'headings' ) ? 'h2' : 'h4' );
// Pages
@patric-boehner
patric-boehner / note.txt
Created April 16, 2018 00:23
Combine multiple .sql files from Local By Flywheel DB backup
cat *.sql > backup.sql
@patric-boehner
patric-boehner / functions.php
Created March 21, 2018 03:28
Add oEmbed support for Google Drive Video
<?php
// Add oEmebed support for Google Drive Video
wp_embed_register_handler(
'google-drive-videos',
'#https?://drive.google\.com/file/d/([a-zA-Z0-9_-]+)/preview$#i',
'pb_add_oembed_handler_dgvideo'
);
function pb_add_oembed_handler_dgvideo( $matches, $attr, $url, $rawattr ) {
@patric-boehner
patric-boehner / wp-cli-command.txt
Created February 14, 2018 19:11
Disable emails in wp staging using two plugins over WP-CLI
wp plugin install log-emails disable-emails
wp plugin activate log-emails disable-emails
@patric-boehner
patric-boehner / search.php
Last active December 1, 2017 08:25
Custom Genesis Search Form, replace input with button
<?php
/**
* You can find the source function for the genesis search form
* within the Genesis theme under > /lib/strucutre/search.php
*
* This updated search from has replaced the <input type="button">
* with a <button> element. This makes it easier to add an icon
* in replacement of the text with the approtraite attribute roles
* that doesn't cause an html validation error.
@patric-boehner
patric-boehner / search.php
Created December 1, 2017 07:45
Order Search Results by Post Type
<?php
/**
* This is copied from Know The Code's
* KTC-Child Theme
* @source: https://github.com/KnowTheCode/KTC-Child-Theme/blob/master/lib/structure/search.php
* Mostly so i can find it in the future
*/
add_filter( 'posts_orderby', __NAMESPACE__ . '\add_orderby_for_search_query', 50 );
@patric-boehner
patric-boehner / responsive-menus-aria-label.js
Last active November 23, 2017 04:06
Update Genesis accessible menu button to add screen reader text or aria-label
/**
* This script adds the accessibility-ready responsive menus Genesis Framework child themes.
*
* @author StudioPress
* @link https://github.com/copyblogger/responsive-menus
* @version 1.1.2
* @license GPL-2.0+
*/
var genesisMenuParams = typeof genesis_responsive_menu === 'undefined' ? '' : genesis_responsive_menu,
@patric-boehner
patric-boehner / genesis-custom-theme-settings.php
Last active November 1, 2017 05:29
Genesis Custom Theme Settings for Site Tagline
<?php
/**
* Custom Genesis Theme Settings
* At the moment this doesn't output anything if the default tagline is empty.
*
* @package Child Theme
* @author Patrick Boehner
* @copyright Copyright (c) 2017, Patrick Boehner
* @license GPL-2.0+
@patric-boehner
patric-boehner / wp-config.php
Last active April 22, 2018 00:57
WP Config Sample
<?php
/**
* This will log all errors notices and warnings to a file called debug.log in
* wp-content (If Apache does not have write permission, you may need to create
* the file first and set the appropriate permissions (i.e. use 660) )
*/
define( 'WP_DEBUG', false ); // Or false
if ( WP_DEBUG ) {
define( 'WP_DEBUG_LOG', true );
@patric-boehner
patric-boehner / code-functions.php
Last active July 16, 2019 17:27 — forked from jdelia/code-functions.php
SVG Icons and Graphic Elements
// Add the SVG icons functions.
include_once( get_stylesheet_directory() . '/lib/icon-functions.php' );