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 / remove-woocommerce-styles-scripts.php
Last active April 25, 2024 09:45
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@gregrickaby
gregrickaby / _mixins.scss
Created September 12, 2013 22:14
The ultimate SASS - PX to REM mixin
// Create REM values with PX fall back
//
// Generate a REM with PX fallback from
// $baseFontSize. Enter the desired size based
// on pixels in numerical form. Supports shorthand.
//
// Forked from: http://codepen.io/thejameskyle/pen/JmBjc
//
// @author Greg Rickaby
// @since 1.0
@gregrickaby
gregrickaby / wp-config.php
Last active January 3, 2024 20:31
WordPress Debugging
<?php
// DO NOT INCLUDE THE OPENING 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.
*/
@gregrickaby
gregrickaby / wp-query-ref.php
Created June 27, 2017 15:24 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?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(
@gregrickaby
gregrickaby / _golden-ratio.scss
Last active August 28, 2023 14:31
Golden Ratio Typography for Sass
//
// Golden Ratio Typography
// --------------------------------------------------
// Golden Ratio Math
//
// Let's do some math so we can build beautiful typography and vertical rhythm.
// For any magic to happen, set the $ContentWidth variable on _variables.scss
// to match your content box width (normally this is 640px, 740px, etc...).
@gregrickaby
gregrickaby / infinite-scroll-masonry-imagesloaded.php
Last active June 14, 2023 13:01
Infinite Scroll + Masonry + ImagesLoaded
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
@gregrickaby
gregrickaby / feed-short.php
Last active January 25, 2023 12:50
Custom RSS template for WordPress
<?php
/**
* Customs RSS template with related posts.
*
* Place this file in your theme's directory.
*
* @package sometheme
* @subpackage theme
*/
@gregrickaby
gregrickaby / functions.php
Last active January 25, 2023 12:50
Custom RSS template for WordPress
<?php
add_action( 'after_setup_theme', 'my_rss_template' );
/**
* Register custom RSS template.
*/
function my_rss_template() {
add_feed( 'short', 'my_custom_rss_render' );
}
@gregrickaby
gregrickaby / feed-short.php
Last active January 25, 2023 12:50
Custom RSS Template for WordPress
<?php
/**
* Customs RSS feed with related posts.
*
* Place this file in your theme's directory.
*
* @package sometheme
* @subpackage theme
*/