Skip to content

Instantly share code, notes, and snippets.

View gregrickaby's full-sized avatar
:octocat:

Greg Rickaby gregrickaby

:octocat:
View GitHub Profile
@gregrickaby
gregrickaby / wdsjQuery.js
Last active April 2, 2021 19:37
WDS Javascript Style
/**
* file: wdsjQuery.js
*
* Handle Foo things for the foo theme.
*/
window.wdsFoo = {};
( function( window, $, app ) {
// Private variable.
var fooVariable = 'foo';
/**
* 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 / change-yoast-seo-metabox-priority.php
Last active September 14, 2020 09:25
Make Yoast SEO your bitch
<?php
/**
* Set Yoast SEO metabox priority to low.
*/
function wds_client_move_yoastseo_metabox() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'wds_client_move_yoastseo_metabox' );
@gregrickaby
gregrickaby / remove-emoji-support.php
Created May 25, 2015 14:34
Remove WordPress Emoji Support
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Remove emoji support.
*/
function grd_remove_emoji() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
@gregrickaby
gregrickaby / wp-config.php
Last active September 26, 2022 04:15
WP DEBUG
<?php // do not include leading php tag
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', true);
@gregrickaby
gregrickaby / web.config
Last active August 29, 2015 14:15
IIS 8.5 WordPress Multisite Rewrite Rules
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule 1" stopProcessing="true">
<match url="^index\.php$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="WordPress Rule 2" stopProcessing="true">
@gregrickaby
gregrickaby / example-nginx.conf
Last active November 22, 2020 20:24 — 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.
################################################################
# 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 September 14, 2020 09:25 — forked from nickdavis/gist:10525079
Redirect local /wp-content/uploads to the development server
#301 Redirect Local Images to Live
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1
@gregrickaby
gregrickaby / echo-an-image.php
Last active November 26, 2018 01:41
Get a WordPress post image, no matter what. Must be used in a loop.
<?php
/**
* Echo an image, no matter what.
*
* @param string $size the image size you want to echo
*/
function wds_do_post_image( $size = 'thumbnail' ) {
// If featured image is present, use that
if ( has_post_thumbnail() ) {
@gregrickaby
gregrickaby / hamburger-nav.html
Created September 12, 2014 14:26
Über basic Hamburger Nav...seriously feel free to contribute and make this suck less.
<!-- The website logo and hamburger icon -->
<div class="mobileNavWrap">
<div class="mobileLogo">
<a href="#"><img src="/some-logo.png" alt="some website" height="100" width="100" /></a>
</div>
<div id="mobileNavIcon">
&#x2261;
</div>
</div>