Skip to content

Instantly share code, notes, and snippets.

View isGabe's full-sized avatar
👨‍💻
:party-code:

Gabriel Luethje isGabe

👨‍💻
:party-code:
View GitHub Profile
@isGabe
isGabe / wp-enqueue-gravity-forms-css.php
Created June 13, 2013 19:59
WordPress: register Gravity Forms stylsheet, only enqueue on Contact page #snippet #WordPress
// Gravity Forms style sheet
wp_register_style( 'gravity-forms', get_stylesheet_directory_uri() . '/library/css/gravity-forms.css', array(), '' );
// only load on contact page
if(is_page('contact')){
wp_enqueue_style('gravity-forms');
}
@isGabe
isGabe / gravity-forms.scss
Created June 13, 2013 19:54
WordPress: Gravity Forms stylesheet, somewhat SASSified #WordPress #snippet
/*
----------------------------------------------------------------
Gravity Forms Front End Form Styles
Version 1.7
http: //www.gravityforms.com
updated: April 22, 2013 5:19 PM
*/
@isGabe
isGabe / cpt-archive-by-tax-term.php
Last active December 18, 2015 10:49
WordPress: CPT Archive Organized by Taxonomy Term #snippet #WordPress
<?php
$tax_name = 'tax_name';
$terms = get_terms($tax_name);
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
echo '<section class="' . $term->name . '">';
echo '<h2 class="section-title">' . $term->name . '</h2>';
echo '<ul>';
@isGabe
isGabe / GrunticonSetup.markdown
Last active December 17, 2015 23:49
Grunticon Setup

Basic Grunticon Setup for CLI Idiots Like Me

I hacked and cursed my way to this point...better write it down!

  1. Install node.js: http://nodejs.org/
  2. Install grunt.js: http://gruntjs.com/getting-started
  3. In the Terminal: $ cd [directory]
  4. Either create package.json and use data in this gist's package.json, or run $ npm init and folow the steps
  5. Make sure to add "grunt": "latest" in devDependencies if you use npm-init to create the package.jason file
  6. Install Grunticon in the project: $ npm install --save-dev grunt-grunticon
  7. Create Gruntfile.js and use data from the Gruntfile.js in this gist. Tweak grunticon file paths as needed.
@isGabe
isGabe / index.html
Created May 22, 2013 17:31
HTML/CSS/JS: Mobile Menu Toggle with CSS Transitions & JS Fallback #snippet
<a id="mobile-menu-toggle" href="#">Menu</a>
<nav id="main-nav" class="closed">
<ul>
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
<li><a href="#">Four</a></li>
<li><a href="#">Five</a></li>
</ul>
@isGabe
isGabe / get_queried_object.php
Last active December 13, 2015 19:48
WordPress: get_queried_object() returns for different objects #snippet #WordPress
/**
* I wanted to know what get_queried_object() returns for different things in WordPress.
*
*/
// I use this to grab the array returned
// depending on what is being queried, it will return a different array of values
<?php
$object = get_queried_object();
var_dump($object);
?>
@isGabe
isGabe / get-highlight-terms.php
Last active February 12, 2022 16:22
WordPress: Output a list of taxonomy terms, then highlight the terms the belong to the current post. Updated to use in_array() to add a "current" CSS class to terms that the current post has. This way we don't have to worry about keeping up with terms in the CSS. Hooray for logic! #snippet #WordPress
<?php
/*
As the title implies, this will give you a way to
1. output a complete list of terms for a given taxonomy (nothing special there)
2. highlight the terms that the current post has (the magic!)
Probably need to figure out a better way to echo out the url of the term archive page...
*/
@isGabe
isGabe / custom-menu-links-widget.php
Created October 12, 2012 23:50
WordPress Plugin - Custom Menu widget with link descriptions #snippet #WordPress
@isGabe
isGabe / random.html
Created October 11, 2012 03:58
Scatter a group of elements randomly with Sass/Compass
<i class="star-1">1</i>
<i class="star-2">2</i>
<i class="star-3">3</i>
<i class="star-4">4</i>
<i class="star-5">5</i>
<i class="star-6">6</i>
<i class="star-7">7</i>
<i class="star-8">8</i>
<i class="star-9">9</i>
<i class="star-10">10</i>
@isGabe
isGabe / functions.php
Created September 19, 2012 18:11
WordPress: Auto versioning of CSS/JS files #snippet #WordPress
/*
Auto-version CSS & JS files, allowing for cache busting when these files are changed.
Place in functions.php or wherever you are enqueueing your scripts & styles
Avoids using query strings which prevent proxy caching
Adjust paths based on your theme setup. These paths work with Bones theme
*/