Skip to content

Instantly share code, notes, and snippets.

View danemorgan's full-sized avatar

Dane Morgan danemorgan

View GitHub Profile
add_filter('nav_menu_link_attributes' , 'att_add_menu_id', 3, 10);
if ( !function_exists( 'att_add_menu_id') ) {
function att_add_menu_id($atts, $item, $args) {
if( 'page' == $item->object ){
$id = $item->object_id;
$id = 'page-'. esc_attr( basename( get_permalink( $id ) ) );
$atts['id'] = $id;
}
return $atts;
}
@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() {
@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() {
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
<?php
################################################################################
// Custom WordPress Local Config
// Use only for Development
// https://gist.github.com/bhubbard/8428583
################################################################################
/* Database Connection Info */
define('DB_NAME', '');
define('DB_USER', '');
@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
@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 / 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 / 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 / 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'