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 / 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 (
@natejacobson
natejacobson / Named item in array
Created November 19, 2013 17:13
Is there a way to do this with one command? Can I echo the specified array item without fetching the array first? These are coming from new customization options setup with $wp_customize. It is working, I'd just like to shorten.
<?php $spine_color = get_option( 'spine_theme_options' ); echo $spine_color['grid_style']; ?>