Skip to content

Instantly share code, notes, and snippets.

View natejacobson's full-sized avatar

Nathan Jacobson natejacobson

  • Discovery Institute
  • Seattle, WA
View GitHub Profile
@natejacobson
natejacobson / gist:fccf376a805c49345a2a
Created January 16, 2015 00:39
Throwing array error.
function spine_excerpt_style_classes( $classes ) {
global $post;
if ( !is_singular() ) {
if ( $post->post_excerpt ) {
$classes[] = "summary-excerpted";
} elseif ( strstr( $post->post_content, '<!--more-->' ) ) {
$classes[] = "summary-divided";
} elseif ( 'excerpt' === spine_get_option( 'archive_content_display' ) ) {
$classes[] = "summary-truncated";
@natejacobson
natejacobson / wsuwp-multiple-feeds
Last active August 29, 2015 14:05
Using the Syndicate plugin of WSUWP, place multiple feeds
(function ($) {
'use strict';
function display_posts(feed, slug, element, title, count) {
if (element == 'main') {
$('main').append(
'<section class="row margin-right gutter feed json shortcode">'
+ '<div id="' + slug + '" class="column one ' + slug + '">'
+ '<h2>' + title + '</h2>'
+ '</div>'
@natejacobson
natejacobson / pull-display-posts
Last active August 29, 2015 14:05
Display posts from WordPress JSON api
(function($){
function display_posts( data ) {
var results = data;
var i = 0;
$.each( results, function( index, value ) {
if(index<3){
console.log( value ); // Use this to see what object properties are available, like date, content, etc...
var html = '';
@natejacobson
natejacobson / equalizing.js
Last active August 29, 2015 13:56
A Column Equalizer
$(document).ready(function(){
function equalizing() {
if( $('.equalize').length ) {
$('.row.equalize .column').css('min-height','');
$('.row.equalize').each(function(){
var tallestBox = 0;
$('.column', this).each(function(){
if($(this).height() > tallestBox) {
tallestBox = $(this).outerHeight();
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
* Mucker: Nate Jacobson
*
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function get_column_options() {
$column_options = array (