Skip to content

Instantly share code, notes, and snippets.

View danemorgan's full-sized avatar

Dane Morgan danemorgan

View GitHub Profile
@danemorgan
danemorgan / parent-theme-mod-fallback.php
Created June 20, 2021 22:38 — forked from justintadlock/parent-theme-mod-fallback.php
Get theme mods that fall back to the stored parent theme mod if child theme is active.
<?php
/**
* The purpose of this code is to show how you can use theme mods that will fall back to
* the already-set mods of the parent theme. So, when a child theme is active, the code
* checks, in the following order: 1) child theme mod, 2) parent theme mod, 3) default.
*/
function jt_get_theme_mod( $name, $default = false ) {
if ( is_child_theme() )
@danemorgan
danemorgan / acf-php-to-json.php
Last active September 30, 2019 19:19 — forked from ollietreend/acf-php-to-json.php
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
@danemorgan
danemorgan / wp.jquery.default.js
Created July 2, 2019 20:48 — forked from bacoords/wp.jquery.default.js
Just a default wrapper
(function($) {
// Any generic functions can go here...
$(document).ready(function($){
// Anything that needs to wait for the document to be ready goes here
});
@danemorgan
danemorgan / ampps-mysql-fix.md
Created October 14, 2017 14:15 — forked from irazasyed/ampps-mysql-fix.md
AMPPS MySQL not working, Solution!

AMPPS MySQL not working, Solution!

  1. Open Ampps Application -> MySQL Tab -> Configuration.

  2. In [mysqld] section, add the following line: innodb_force_recovery = 1

  3. Save the file and try starting MySQL

  4. Remove that line which you just added and Save.

@danemorgan
danemorgan / a11y-theme-review.txt
Last active January 19, 2017 10:50 — forked from davidakennedy/a11y-theme-review.txt
A collection of review template responses for WordPress theme reviews.
Hi there!
Thanks for creating a WordPress theme and submitting it to the WordPress.org directory! Since your theme also includes the accessibility-ready tag, I've also reviewed it according to those requirements, which you can find here: https://make.wordpress.org/themes/handbook/review/accessibility/
Required
Anything in this section will need to be fixed before the theme can be approved.
Keyboard Navigation
@danemorgan
danemorgan / wget.sh
Last active August 29, 2015 14:06 — forked from lyoshenka/wget.sh
wget --mirror --page-requisites --continue --convert-links --user-agent="" --execute robots=off --wait 1 URL
<?php
################################################################################
// Custom WordPress Local Config
// Use only for Development
// https://gist.github.com/bhubbard/8428583
################################################################################
/* Database Connection Info */
define('DB_NAME', '');
define('DB_USER', '');
For more details, see http://code.garyjones.co.uk/install-wordpress-ssh/
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz
cd wordpress
cp -rpf * ../
cd ../
rm -rf wordpress/
rm -f latest.tar.gz
@danemorgan
danemorgan / IE conditional tags for stylesheets in wp_head
Last active December 22, 2015 08:38 — forked from GaryJones/functions.php
Wrap stylesheet in ie conditional tags for wp_head
<?php
add_action( 'wp_enqueue_scripts', 'child_add_ie7_style_sheet', 200 );
/**
* Enqueue a IE-specific style sheet (for all browsers).
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/ie-conditional-style-sheets-wordpress/
*/
function child_add_ie7_style_sheet() {
@danemorgan
danemorgan / IE conditional tags for scripts in wp_head
Last active December 22, 2015 08:29 — forked from GaryJones/functions.php
.Untested. Should wrap javascript in ie conditional tags. Will update after testing.
<?php
add_action( 'wp_enqueue_scripts', 'child_add_ie_script', 200 );
/**
* Enqueue a IE-specific style sheet (for all browsers).
* @author Gary Jones
* @link http://code.garyjones.co.uk/ie-conditional-style-sheets-wordpress/
*/
function child_add_ie_script() {