Skip to content

Instantly share code, notes, and snippets.

View zoerooney's full-sized avatar

Zoe Rooney zoerooney

View GitHub Profile
@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">
<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-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' %}
@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 / 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 / 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 / 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 / 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 -->