Skip to content

Instantly share code, notes, and snippets.

Craig Simpson craigsimps

Block or report user

Report or block craigsimps

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View functions.php
<?php
/**
* Remove redundant Genesis meta boxes.
*
* @param string $pagehook Page hook for the Theme Settings page.
*
* @since 1.1.0
*/
add_action( 'genesis_theme_settings_metaboxes', function ( $pagehook ) {
View plugin.php
<?php
/**
* Generico Core
*
* Core plugin, holding theme-agnostic functionality specific to the site.
*
* @package Generico\Core
* @author Craig Simpson <craig@craigsimpson.scot>
* @license MIT
* @link https://craigsimpson.scot
View functions.php
<?php
/**
* Stop Genesis adding `header-*` classes to <body>.
*
* @since 1.0.0
*/
remove_filter( 'body_class', 'genesis_header_body_classes' );
View functions.php
<?php
add_action( 'genesis_meta', __NAMESPACE__ . '\\remove_redundant_markup' );
/**
* Remove the redundant .site-inner and .content-sidebar-wrap markup.
*
* @since 1.0.0
*/
function remove_redundant_markup() {
View template-testimonials.php
<?php
/**
* Template Name: Testimonials - ACF Functions
*/
add_action( 'genesis_entry_content', 'prefix_output_testimonials' );
/**
* Output ACF testimonials.
*
* @link https://acfextras.com/simple-testimonials-repeater-field/
View global.js
/* ========================================================================
* DOM-based Routing
* Based on http://goo.gl/EUTi53 by Paul Irish
* ======================================================================== */
(function ($) {
var Whitespace = {
common: {
init: function () {
// Run everywhere.
View functions.php
<?php
add_action( 'bcn_after_fill', 'project_rebuild_breadcrumb' );
/**
* Rebuild the breadcrumb created by Breadcrumb NavXT.
*
* @param bcn_breadcrumb_trail $breadcrumb Instance of the currently active breadcrumb trail.
*/
function project_rebuild_breadcrumbs( $breadcrumb ) {
View functions.php
<?php
add_filter( 'option_active_plugins', __NAMESPACE__ . '\disable_acf_on_frontend' );
/**
* Disable ACF Pro on website frontend.
*
* Provides a performance boost if ACF frontend functions aren't being used.
*
* @since 1.0.0
* @link https://www.billerickson.net/code/disable-acf-frontend/
View template-testimonials-native.php
<?php
/**
* Template Name: Testimonials - Native Functions
*/
add_action( 'genesis_entry_content', 'prefix_output_testimonials' );
/**
* Output ACF testimonials.
*
* @link https://acfextras.com/simple-testimonials-repeater-field/
View functions.php
<?php
add_filter( 'facetwp_map_init_args', 'prefix_prevent_scroll_zoom_on_facet_map' );
/**
* Filter the Google Map options to prevent scrollwheel zoom.
* @link https://craigsimpson.scot/filter-facetwp-google-map-options
*
* @param array $args Array of init settings for Google map.
*
* @return array $args Modified array.
You can’t perform that action at this time.