Skip to content

Instantly share code, notes, and snippets.

View webprom's full-sized avatar

Iggy Pritzker webprom

View GitHub Profile
@billerickson
billerickson / gist:3714550
Created September 13, 2012 14:09 — forked from anonymous/gist:3712088
Sample Child Theme with Post Format
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );
/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Sample Child Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/genesis' );
/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'add_viewport_meta_tag' );
@srikat
srikat / waypoints-init.js
Last active November 17, 2016 18:54
Using Waypoints jQuery to animate and fade in elements as they come in focus in WordPress. http://sridharkatakam.com/using-waypoints-jquery-animate-fade-elements-scrolled-wordpress/
.home-featured .simple-social-icons ul li a.animate {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
@scrubmx
scrubmx / accordion.js
Last active October 10, 2021 17:16
Simple jQuery Accordion implementation for <dl> element
// Accordion - Container
var $listContainer = $('dl.description-list');
$listContainer.on('click', 'dt:not(.active)', function(){
$listContainer.find('dt.active').removeClass('active');
$listContainer.find('dd').slideUp();
$(this).addClass('active').next('dd').slideDown();
});
$listContainer.on('click', 'dt.active', function(){
@vagnerolliver2
vagnerolliver2 / theme.template.js
Created April 7, 2015 21:48
Javascript do Template Zendesk
/*
* jQuery v1.9.1 included
*/
$(document).ready(function() {
// social share popups
$(".share a").click(function(e) {
e.preventDefault();
window.open(this.href, "", "height = 500, width = 500");
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 );
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) {
remove_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 );
if ( $product->is_on_sale() ) {
$eligible = false;
}
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 );
@jonnymaceachern
jonnymaceachern / mobile-resize-check.js
Created September 4, 2015 14:29
A resize event is triggered when a mobile browsers address bar drops down (when changing directions in a scroll). This will let you check for only width resizes. From http://stackoverflow.com/questions/10750603/jquery-detect-a-window-width-change-but-not-a-height-change
var width = $(window).width();
$(window).resize(function(){
if($(this).width() != width){
width = $(this).width();
console.log(width);
// your code
}
});
@mikejolley
mikejolley / ipn-test.php
Last active September 18, 2020 14:29
Quick snippet/plugin/dropin to test IPN support
<?php
/**
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
*/
if ( ! defined( 'ABSPATH' ) ) {
@derekshirk
derekshirk / acf-inline-svg.php
Created July 20, 2016 22:14
Output Inline SVGs from ACF image field
<?php
/* ————————————————————————— */
/* ACF Inline SVGs
/* ————————————————————————— */
$repeater = 'repeater_field_name'
if ( have_rows( $repeater ) ): ?>
<section class="content-main">
<div class="container"> <?php
@tavy315
tavy315 / .htaccess
Last active May 7, 2021 20:33
Enable GZip compression & Leverage browser caching
AddDefaultCharset UTF-8
Options -Indexes
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
@amboutwe
amboutwe / yoast_seo_canonical_change_woocom_shop.php
Last active July 12, 2024 15:17
Code snippets for the Yoast SEO canonical output
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change the canonical link for the shop page
* Credit: Scott Weiss of somethumb.com
* Yoast Doc: https://developer.yoast.com/features/seo-tags/canonical-urls/api/
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1
*/
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 );