Skip to content

Instantly share code, notes, and snippets.

💻
<code />

Greg Rickaby gregrickaby

💻
<code />
Block or report user

Report or block gregrickaby

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 wp-query-ref.php
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
View gist:5d3bc24e60d272bb74255cfdb7828f41

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@gregrickaby
gregrickaby / jsClass.jQuery.js
Created Jan 11, 2016 — forked from aubreypwd/jsClass.jQuery.js
How to create a Js application as a jQuery plugin
View jsClass.jQuery.js
( function( $ ) {
// Create a jQuery Object.
$.fn.myObject = function() {
var target = this; // Store the target element in this variable (jQuery stuff).
// Our stuff.
this.object = {
/**
@gregrickaby
gregrickaby / myObject.js
Created Jan 11, 2016
Creating a global Js Object
View myObject.js
// Create an object in the global scope, pass in window, jQuery, and the global object into the anonymous function.
window.myObject = ( function( window, $, myObject ) {
// Create our object, properties, and functions.
myObject = {
window: $( window ), // Remove if you don't need it, makes your object smaller.
// Access variables using myObject.options
options {
View Disable Plugins.md

Disable Plugins

Quickly disable all plugins in WordPress.

Usage

This plugin needs to go into the wp-content/mu-plugins/ directory. Provided you have SSH access to the server where WordPress lives, you can do this:

cd $SITE_ROOT/wp-content/mu-plugins
View fix_msword.php
/**
* fixMSWord
*
* Replace ascii chars with utf8. Note there are ascii characters that don't
* correctly map and will be replaced by spaces.
*
* Updated 7-15-2015 by Jay Wood to encode lower end items into HTML entity counterparts.
*
* @author Robin Cafolla,Jay Wood
* @date 2013-03-22
@gregrickaby
gregrickaby / example-nginx.conf
Last active May 22, 2019 — forked from pmgarman/gist:8fba357c97193633a66d
Defer the loading of images to the production server. Use either Apache or NGINX depending on your local server setup.
View example-nginx.conf
################################################################
# Example configuration file for nginx
#
# To add a new local WordPress domain to your environment, copy
# this file using a filename that matches the domain you wish to
# setup. For example - mylocaldomain.com.conf would be an ideal
# filename for http://mylocaldomain.com
#
# Once copied, you will need to modify two settings in the server
# configuration provided:
@gregrickaby
gregrickaby / .htaccess
Last active Jan 2, 2019 — forked from nickdavis/gist:10525079
Redirect local /wp-content/uploads to the development server
View .htaccess
#301 Redirect Local Images to Live
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1
You can’t perform that action at this time.