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-bootstrap-walker-class.php
Created March 12, 2012 23:12 — forked from duanecilliers/wp-bootstrap-walker-class.php
Extended Walker Class for Twitter Bootsrap Navigation Wordpress Integration
<?php
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth ) {
//In a child UL, add the 'dropdown-menu' class
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"dropdown-menu\">\n";
@isGabe
isGabe / gist:3072378
Created July 8, 2012 19:16
Load jQuery fron Google CDN with local fallback - WordPress style
<?php
/*
**** Load jQuery from Google CDN if available, local fallback if not ****
** Place in your theme's functions.php or relevant file. Edit local jQuery path if needed.
** Works as-is with WordPress Bones Theme v1.2 https://github.com/eddiemachado/bones (replace wp_enqueue_script( 'jquery' ); on line 142
** reference: http://wp.tutsplus.com/tutorials/load-jquery-from-google-cdn-with-local-fallback-for-wordpress/
*/
@isGabe
isGabe / wp_custom_title_placeholder_text.php
Last active February 25, 2019 21:28
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
@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
*/
@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 / custom-menu-links-widget.php
Created October 12, 2012 23:50
WordPress Plugin - Custom Menu widget with link descriptions #snippet #WordPress
@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 / 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 / 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 / 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.