This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var glob = require('glob'); | |
var objectAssign = require('react/lib/Object.assign'); | |
var defaults = { | |
folder: './app/node_modules/components/', | |
extension: '.jsx' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Middleware | |
var middleware = require('./middleware/components.js'); | |
app.use(middleware); | |
// Require the core Styleguide | |
var Styleguide = require('../app/node_modules/styleguide/layout'); | |
var styleguideProps = this.props; | |
// Json for all components | |
app.get('/components.json', function(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function supportsWoff2() { | |
"use strict"; | |
/*global FontFace*/ | |
// Source: https://github.com/filamentgroup/woff2-feature-test | |
if (!window.FontFace) { | |
return false; | |
} else { | |
var f = new FontFace('t', 'url("data:application/font-woff2,") format("woff2")', {}); | |
f.load(); | |
return f.status === 'loading'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=font-scale($sizes, $namespace: "copy", $micro_class: true) | |
@each $scale in $sizes | |
$current-breakpoint: nth($scale,1) | |
$current-font-size: nth($scale,2) | |
$base-size: $current-font-size !default | |
@if $current-breakpoint > 0 | |
+mq-min($current-breakpoint) | |
.#{$namespace} | |
font-size: $current-font-size | |
@if $micro_class == true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Return the page id by slug | |
// ------------------------------------------------------------- | |
function get_ID_by_slug( $page_slug ) { | |
$page = get_page_by_path( $page_slug ); | |
if ( $page ) { | |
return $page->ID; | |
} else { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* for <a href="#" class="logo"><img src="..."></a> */ | |
.logo, | |
.logo:before { | |
height: 75px; | |
width: 275px; | |
display: block; } | |
.logo { | |
position: relative; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$morestring = '<!--more-->'; | |
$explode_content = explode( $morestring, $post->post_content ); | |
$content_before = apply_filters( 'the_content', $explode_content[0] ); | |
$content_after = apply_filters( 'the_content', $explode_content[1] ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add PDF filter to media library | |
add_filter( 'post_mime_types', 'modify_post_mime_types' ); | |
function modify_post_mime_types( $post_mime_types ) { | |
// select the mime type, here: 'application/pdf' | |
// then we define an array with the label values | |
$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) ); | |
// then we return the $post_mime_types variable | |
return $post_mime_types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add category filters to WP custom post types | |
add_action( 'restrict_manage_posts', 'my_add_category_filters' ); | |
function my_add_category_filters() { | |
global $typenow; | |
if( $typenow == "event" ){ | |
$taxonomy = 'event_type'; | |
} | |
elseif( $typenow == "guideline" ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add past/future events filter | |
add_action( 'restrict_manage_posts', 'my_add_past_prev_filter' ); | |
function my_add_past_prev_filter() { | |
global $typenow; | |
// get our time period filter (if applied) | |
$time_period = $_GET['time_period']; | |
// set our select options |
NewerOlder