Skip to content

Instantly share code, notes, and snippets.

View zoerooney's full-sized avatar

Zoe Rooney zoerooney

View GitHub Profile
@zoerooney
zoerooney / breadcrumbs.liquid
Last active September 7, 2016 03:38
Shopify product breadcrumbs showing tag-based subcategories. Full tutorial here: http://zoerooney.com/blog/tutorials/shopify-product-breadcrumbs-with-tag-support/
<div class="breadcrumbs">
<a href="/" class="homepage-link">Home</a>
{% if collection.handle %}
&gt;
{% capture url %}/collections/{{ collection.handle }}{% endcapture %}
<a href="{{ collection.url }}" class="collection-link">{{ collection.title }}</a>
{% endif %}
<span class="bc-tags"></span><!-- this is a placeholder for the tag if there is one -->
</div> <!-- end .breadcrumbs -->
@zoerooney
zoerooney / feed-example.html
Last active December 22, 2015 10:15
Pinterest via RSS feed and Google Feed API, as discussed here: http://zoerooney.com/blog/tutorials/display-a-pinterest-feed-almost-anywhere-via-rss/
<div id="pinfeed"></div>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<!-- ref: https://developers.google.com/feed/v1/devguide -->
<script type="text/javascript">
google.load('feeds', '1');
function initialize() {
@zoerooney
zoerooney / jquery.js
Last active August 15, 2023 02:21
Shopify minicart on non-Shopify site
<script>
jQuery.ajax({
type: 'GET',
url: 'http://mysite.myshopify.com/cart.json',
dataType: 'jsonp',
success: function(data) {
var item_count = data['item_count'];
var total_price = data['total_price']/100;
//If there are items in cart
@zoerooney
zoerooney / tweet-quicktag.php
Last active July 9, 2016 12:01
Code to add inline click-to-tweet links in WordPress while using the text editor. Full tutorial here: http://zoerooney.com/blog/tutorials/inline-click-to-tweet-functionality/
function add_tweet_quicktag(){ ?>
<script>
// create a new quicktag button labeled "tweet"
QTags.addButton( 'quicktweet', 'tweet', selection_callback );
// on click, it triggers this callback:
function selection_callback(e, c, ed) {
// we want to grab the selected text and we're going to get a URL as well
var selection, postURL, t = this;
@zoerooney
zoerooney / page-gallery.php
Last active April 6, 2021 14:29
Gallery page using ACF PRO with a dynamically generated zip file download of all gallery images. More info/ tutorial here: http://zoerooney.com/blog/tutorials/wordpress-gallery-with-automated-zip-file-download/
@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' %}
<div id="instagram" class="widget">
<?php
// Set variables
$image_number = 2;
$image_size = 'low_resolution'; //options: low_resolution (306), thumbnail (150), standard_resolution (612)
// Create the API URL for the user data
$user_access_token = '123456.xxxxxxxx.zzzzzzzzzzzzzzzzzzzzzzz';
$user_data_url = 'https://api.instagram.com/v1/users/self/?access_token=' . $user_access_token;
@zoerooney
zoerooney / page-shopify.php
Last active April 3, 2020 12:44
Shopify Collection Embedded in WordPress
<?php
/**
* Template Name: Shopify Collection Demo
*
*/
get_header(); ?>
<div id="primary" class="full-width">
@zoerooney
zoerooney / markup.html
Created August 8, 2014 18:41
Instafeed with links opening in new window
<div id="instafeed"></div>
<script>
var feed = new Instafeed({
clientId: 'XXXXXXXXXXXXXXXXXX',
accessToken: 'abcdefghijklmnop',
get: 'user',
userId: 12345678,
limit: 5,
after: function() {
external();
@zoerooney
zoerooney / header-for-most-emails.html
Last active August 1, 2018 13:49
Shopify notification emails, bettered. I usually use the first one as the header for all the emails other than the ones with specific template code below. Be sure to put the correct logo dimensions in place in each snippet before using it!
<div style="width: 100%; margin: 0 auto; text-align: center; background: #ffffff;">
<a href="{{ shop.url }}"><img src="{{ 'logo.png' | asset_url }}" alt="{{ shop_name }}" width="WIDTH" height="HEIGHT" style="margin: 0 auto;" /></a>
<br/><br/>
</div>