Skip to content

Instantly share code, notes, and snippets.

View NatalieMac's full-sized avatar

Natalie NatalieMac

View GitHub Profile
.site-header {
@extend %row;
}
.site-branding {
@include col(24);
}
.site-title {
@include col(24);
%row {
@include display-flex;
@include flex-wrap(wrap);
margin-left: $page-gutter;
margin-right: $page-gutter;
}
@mixin col($span) {
@include box-sizing(border-box);
padding: 0 $gutter/2;
$columns: 24;
$page-gutter: 100%/($columns + 2);
$column: 100%/($columns);
$gutter: 1.5rem;
<h1>Colors</h1>
<h2>Lightening</h2>
<div class="color-strips">
<div class="color-strip color1 lighten">
<div class="color-sample original">#f3ac9f</div>
<div class="color-sample c10">10%</div>
<div class="color-sample c20">20%</div>
<div class="color-sample c30">30%</div>
<div class="color-sample c40">40%</div>
$this.on('mouseover touchstart mouseout touchend click focus blur keypress', function(e) {
var type = e.type;
e.preventDefault();
switch (type) {
case 'touchstart':
mapOver($this, img, type);
mapClick($this, img);
break;
case 'touchend':
var resizeDelay = (function() {
var timers = {};
return function (callback, ms, uniqueId) {
if (!uniqueId) {
uniqueId = Math.random() * 100;
}
if (timers[uniqueId]) {
clearTimeout (timers[uniqueId]);
}
timers[uniqueId] = setTimeout(callback, ms);
@NatalieMac
NatalieMac / functions.php
Last active August 29, 2015 14:11
Set up multiple views of a single template that appear as subpages in the URL (WordPress)
function prefix_cpt_rewrite() {
add_rewrite_tag( '%view%', '([^&]+)' );
}
add_action( 'init', 'prefix_cpt_rewrite' );
function prefix_cpt_rewrite_rules() {
$slug = 'cpt-slug';
$param_name = 'view';
$param_val = 'map';
;(function ($, yourslug, undefined) {
var mainNav = function() {
// This is a private function
};
yourslug.init = function() {
// This is a public funciton
};
<?php
// add yearly archives for custom post type
function custom_post_rewrite( $rewrite_rules ) {
$pagination_base = $GLOBALS['wp_rewrite']->pagination_base;
$slug = 'cpt slug goes here';
$year_archive = array(
$slug . '/([0-9]{4})/' . $pagination_base . '/?([0-9]{1,})/?$' => 'index.php?post_type=' . $slug . '&year=$matches[1]&paged=$matches[2]',
$slug . '/([0-9]{4})/?$' => 'index.php?post_type=' . $slug . '&year=$matches[1]',
);
sd;lfksdjf;ldskjf
sdjflsdjf;lsdkfjsda
fjsdaklfjdsf;lksdjfls