Skip to content

Instantly share code, notes, and snippets.

View zoerooney's full-sized avatar

Zoe Rooney zoerooney

View GitHub Profile
<?php
// create a variable, use it to get the lead time digit from an ACF custom field
$lead_time = get_field('lead_time');
// then display the date relative to that lead time
echo date('F Y', strtotime('+'.$lead_time.' weeks'));
?>
@zoerooney
zoerooney / functions.php
Last active December 17, 2015 11:09
UnoSlider (http://unoslider.npmedia.net/) + WordPress Slider Tutorial Code [Tutorial Coming Soon]
<?php
/**
* ENQUEUE SCRIPTS
*/
function add_new_scripts_method() {
if ( is_page_template('page-with-slider.php') ) :
wp_enqueue_script(
'unoslider',
get_template_directory_uri() . '/js/unoSlider-1.0.1.min.js',
array('jquery')
@zoerooney
zoerooney / jquery-hash-filtering.js
Last active December 17, 2015 10:59
A few different ways to use URL information in WordPress themes, from a mini-tutorial here: http://zoerooney.com/blog/tutorials/using-the-referring-page-in-wordpress/
jQuery(document).ready(function($){
// Read URL and determine if it contains "free"
if(window.location.href.indexOf("free") > -1 ) {
// If it does, filter the list
$.filtrify("patterns-list", "filter", {
close : true, // let's not have any drop downs open
query : {
"cost" : ["free"] // pre-set the filter to only show free patterns
},
<?php if ( has_post_format( 'gallery' )) { ?>
<div class="controls"></div>
<div class="slideshow"></div>
<div class="captionbox"></div>
<div class="thumb-wrapper">
<?php $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => null, 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => -1 ) );
if( $images ): ?>
<ul class="thumbs noscript">
<?php foreach( $images as $attachment_id => $attachment ): ?>
<li>
@zoerooney
zoerooney / gist:5246765
Last active December 15, 2015 10:39 — forked from anonymous/gist:5232727
<?php
/**
* Template Name: Portfolio
* Created by Zoe Rooney http://zoerooney.com
*/
get_header(); ?>
<div id="primary" class="full-width">
<div id="content" role="main">
@zoerooney
zoerooney / dabblet.css
Created March 17, 2013 18:10
Flamingo Sample
/**
* Flamingo Sample
*/
body {
font-family: sans-serif;
font-size: 14px;
padding: 50px;
background: #333;
}
@zoerooney
zoerooney / dabblet.css
Created March 17, 2013 18:07
Flamingo Sample
/**
* Flamingo Sample
*/
body {
font-family: sans-serif;
font-size: 14px;
padding: 50px;
background: #333;
}
@zoerooney
zoerooney / dabblet.css
Created March 17, 2013 16:48 — forked from anonymous/dabblet.css
About HTML & CSS
/*
* About HTML & CSS
*/
/*
body {
font-family: Arial, sans-serif;
font-size: 14px;
padding: 50px
@zoerooney
zoerooney / dabblet.css
Created March 17, 2013 16:47
Flamingo Sample
/**
* Flamingo Sample
*/
body {
font-family: sans-serif;
font-size: 14px;
padding: 50px
}
@zoerooney
zoerooney / page-directory.liquid
Last active August 29, 2015 14:15
Directory using Shopify blog content, sorted by title, with in-page quick search. As seen on: http://afavoritedesign.com/pages/the-peddlers with a full tutorial here: http://zoerooney.com/blog/tutorials/shopify-alphabetical-searchable-directory-page/
<header class="page-title">
<h1>{{ page.title }}</h1>
</header>
<section id="content">
<div class="search-area">
<div class="left">{{ page.content }}</div>
<div class="right"><form><i class="icon-search"></i><input type="text" id="peddler-search" placeholder="type your city, state or postal code"></form></div>
</div>
<div class="locations">
{% assign sorted_articles = blogs.peddlers.articles | sort: 'title' %}