Skip to content

Instantly share code, notes, and snippets.

@patric-boehner
patric-boehner / functions.php
Last active January 15, 2017 20:40
Update to Genesis responsive menu script to change the JS body class to NOJS
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Add sitewide body class no-js to more easily style for when js is disabeled.
/* This is purly prefrance. By default the responsive-menu.js script normaly adds
* a js body class when js is present but has no body class for when js is disabled,
* which can be problamatic when you prefer to sytle based on the lack of JS
*/
@patric-boehner
patric-boehner / add-icon-ssi.php
Last active January 15, 2017 20:40
Add an icon to Simple Social Icon
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Loading from a custom plugin
add_filter( 'simple_social_default_profiles', 'custom_add_new_simple_icon' );
function custom_add_new_simple_icon( $icons ) {
$icons['goodreads'] = [
'label' => __( 'Goodreads URI', 'simple-social-icons' ),
@patric-boehner
patric-boehner / responsive-menu.js
Last active September 2, 2016 02:52
Updating Genesis responsive menus to merge multiple menus for mobile layout
/**
* Accessibility-ready responsive menu.
*/
( function ( document, $, undefined ) {
$( 'body' ).addClass( 'js' );
'use strict';
@patric-boehner
patric-boehner / functions.php
Created August 31, 2016 19:38
Add support for Genesis scripts in-post option for custom post types
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Add support for the Genesis Scripts meta box on a custom post type
add_post_type_support( 'download', 'genesis-scripts' );
@patric-boehner
patric-boehner / functions.php
Last active September 23, 2022 02:55
Removing in-post settings for the Genesis Framework, including seo, layout and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
/*
* You can find the refrance for supports that Genesis adds
* in the core files lib > admin > inpost-metaboxes.php
*/
//* Remove Action
@patric-boehner
patric-boehner / a-shortcode-ui.php
Last active August 30, 2016 19:26
A Shortcake UI example adding an editable button (cta) into body content in wordpress.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//**********************************************
// Setup CTA Button Widget
//**********************************************
/*
* We have three attributes:
* - Button Text
@patric-boehner
patric-boehner / shortcode.php
Last active August 30, 2016 19:27
Minimal example of a Short Code
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Minimal Shortcode
add_shortcode( 'cta_button', 'pb_register_button_shortcode' );
function pb_register_button_shortcode( $atts ){
/*
* We return a pre formatted string with no variables.
@patric-boehner
patric-boehner / custom-site-description-widget.php
Last active August 30, 2016 19:29
Site Description Widget in Genesis
<?php
// Custom Site Description Widget
//**********************************************
/**
* @package CoreFunctionality
* @since 2.0.0
* @copyright Copyright (c) 2016, Patrick Boehner
* @license GPL-2.0+
@patric-boehner
patric-boehner / function.php
Last active August 26, 2016 04:59
Add a widget area to all single pages in genesis
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
///* Register Page Widget
genesis_register_sidebar( array(
'id' => 'page-content-widget',
'name' => __( 'Page Content Widget', 'themename' ),
'description'=> __( 'This widget area shows within single page content area only.', 'themename' ),
@patric-boehner
patric-boehner / gitignore
Last active March 1, 2020 00:23
A Sample Gitignore file originally from Bill Erickson
# Ignore everything #
**
!wp-content/
wp-content/**
!wp-content/themes/
!wp-content/plugins/
wp-content/themes/**
wp-content/plugins/**
# Add two rules for each Theme or Plugin you want to include: