Skip to content

Instantly share code, notes, and snippets.

View verticalgrain's full-sized avatar

Jamie Graham verticalgrain

View GitHub Profile
@verticalgrain
verticalgrain / Simple social sharing links
Created May 1, 2014 21:19
Simple social sharing links
@verticalgrain
verticalgrain / button-styles.scss
Created June 2, 2014 17:13
Animated hamburger navigation icon
/* The navigation button x close effect
/* with help from: http://sarasoueidan.com/blog/navicon-transformicons/
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + */
$button-size : 18px;
$transition: .3s; // adjust this to adjust animation speed
/* Styles for the button itself */
@verticalgrain
verticalgrain / _grid.scss
Last active August 29, 2015 14:09
Susy Grids - Basic configuration and basic usage examples
// Import main susy stylesheet. Assumes Compass is being used on the project
@import 'susy';
$column-count: 12;
// Main Configuration settings for the Susy Grid
// Docs: http://susy.readthedocs.org/en/latest/settings/
$susy: (
columns: $column-count, // Number of columns in the grid
global-box-sizing: border-box, // Tells Susy to use border-box
@verticalgrain
verticalgrain / basic-wp-loop.php
Last active August 29, 2015 14:10
Basic Wordpress Loop - using WP_Query
<?php
// Query arguments go here - for all query arguments see: http://goo.gl/GuIvSn
$args = array(
//'numberposts' => -1,
//'post_type' => 'event',
//'meta_key' => 'location',
//'meta_value' => 'Melbourne'
);
@verticalgrain
verticalgrain / susy-grids-useful-snippets.scss
Last active August 29, 2015 14:10
Susy Grids - Useful Snippets
// Default susy sass map of configuration options.
// These are the defaults. More information can be found here: http://susy.readthedocs.org/en/latest/settings/
$susy: (
flow: ltr,
math: fluid,
output: float,
gutter-position: after,
container: auto,
container-position: center,
columns: 4,
@verticalgrain
verticalgrain / gist:ae8ac5dbe84fd588d50c
Last active August 29, 2015 14:13
Advanced Custom Fields multipe options pages - with sub pages
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Options',
'menu_title' => 'Options',
'menu_slug' => 'options',
'capability' => 'edit_posts',
'icon_url' => 'dashicons-forms',
'redirect' => false
));
@verticalgrain
verticalgrain / wp-cron.php
Last active September 4, 2017 17:55
Example WP Cron job
<?php
// On the scheduled action hook, run a function.
function my_cron_job_function() {
// Put all your codez here
// Sample code fetches a json feed and caches it by saving it as a file
set_time_limit(0);
//File to save the contents to
@verticalgrain
verticalgrain / animated-hamburger.html
Last active August 29, 2015 14:14
Animated hamburger menu trigger - animates from a hamburger to an "X" - SCSS, HTML, JS, Compass
<div class="nav-trigger">
<span></span>
<span></span>
<span></span>
</div>
@verticalgrain
verticalgrain / acf-image.sublime-snippet
Last active August 29, 2015 14:16
Sublime snippet - ACF image
<!-- Sublime text snippet for calling an advanced custom fields image in a Wordpress theme file -->
<snippet>
<content><![CDATA[
<?php \$image = get_field('${1:acf_field_id}');
if( !empty(\$image) ): ?>
<img src="<?php echo \$image['sizes']['${2:thumbnail}']; ?>" alt="<?php echo \$image['title']; ?>" />
<?php endif; ?>
$0
]]></content>
<tabTrigger>image</tabTrigger>
@verticalgrain
verticalgrain / adminstyle.templatefunction.php
Created March 3, 2015 19:13
Add CSS styles to WP admin
// Add some styles to the admin end
function admin_styles() {
echo '<style type="text/css">
#menu-comments, #menu-links, #menu-media, #menu-dashboard { display:none; }
</style>';
}
add_action('admin_head', 'admin_styles');