Skip to content

Instantly share code, notes, and snippets.

View nucab's full-sized avatar
🏠
Working from home

Noah U nucab

🏠
Working from home
View GitHub Profile
<?php
if ( is_shop() || is_product_category() || is_product_tag() ) { // Only run on shop archive pages, not single products or other pages
// Products per page
$per_page = 24;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array(
@nucab
nucab / functions.php
Last active August 29, 2015 14:25 — forked from jameskoster/functions.php
WooCommerce - dequeue css (2.1+)
// Remove each style one by one
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
function jk_dequeue_styles( $enqueue_styles ) {
unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss
unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout
unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation
return $enqueue_styles;
}
// Or just remove them all in one line
<?php
/*
Extends Visual Composer
More information can be found here: http://kb.wpbakery.com/index.php?title=Category:Visual_Composer
*/
// don't load directly
@nucab
nucab / all-actions-list.php
Last active September 12, 2015 19:15 — forked from thefuxia/all-actions-list.php
Plugin All Actions List
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: All Actions List
Description: Lists all actions run during one request.
Version: 1.0
Required: 3.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
@nucab
nucab / js_google_fonts_async_ieshim
Last active September 13, 2015 00:58 — forked from kosmiq/js_google_fonts_async_ieshim
An updated version of Thomas Bensmanns Load Google Fonts via JS (https://bensmann.no/google-webfonts-performance/) with a SHIM for IE9 and IE8.
WebFontConfig = {
google: { families: [ \'Ek+Mukta:200,800:latin\' ] }
};
var cb = function() {
var wf = document.createElement(\'script\');
wf.src = \'//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js\';
wf.type = \'text/javascript\';
wf.async = \'true\';
var s = document.getElementsByTagName(\'script\')[0];
s.parentNode.insertBefore(wf, s);
@nucab
nucab / breadcrumbs.php
Created December 23, 2015 15:28 — forked from jazzsequence/breadcrumbs.php
WordPress SEO Breadcrumbs
/**
* SEO Breadcrumbs
* @author Chris Reynolds
* @link http://www.quickonlinetips.com/archives/2012/02/wordpress-seo-breadcrumbs/
* Search engine optimized breadcrumbs. Original source was taken from the link above, with changes made so that it supports pages as well as posts and integrates into Twitter Bootstrap breadcrumb styles
*/
function seo_breadcrumbs() {
// this sets up some breadcrumbs for posts & pages that support Twitter Bootstrap styles
$separator = ' <span class="divider">&rsaquo;</span>';
echo '<ul xmlns:v="http://rdf.data-vocabulary.org/#" class="breadcrumb">';
@nucab
nucab / RRIntegrationCode.html
Created January 1, 2016 22:29 — forked from charleshimmer/RRIntegrationCode.html
Bazaarvoice RR integration code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<script src="//display-stg.ugc.bazaarvoice.com/static/Bazaarvoice/bvapi.js"></script>
<script>
@nucab
nucab / BVProductList.html
Created January 1, 2016 22:29 — forked from elmogallen/BVProductList.html
Inline Bazaarvoice Ratings and Reviews with Read Reviews link
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- TODO:
Do some kind of loop here to show your results.
Inside the loop, you'd generate HTML similar to the following: -->
<div id="BVRRInlineRating-{productId}"></div>
<a href="" class="bvReadReviews" data-pid="{productId}">Read reviews</a>
<!-- End Loop That Generates HTML for results -->
@nucab
nucab / jquery.waituntilexists.js
Created February 2, 2016 15:08 — forked from buu700/jquery.waituntilexists.js
jQuery plugin which runs handler function once specified element is inserted into the DOM
(function ($) {
/**
* @function
* @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
* @param {function} handler A function to execute at the time when the element is inserted
* @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
* @example $(selector).waitUntilExists(function);
*/
/*
* jYoutube 1.0 - YouTube video image getter plugin for jQuery
*
* Copyright (c) 2009 jQuery Howto
*
* Licensed under the GPL license:
* http://www.gnu.org/licenses/gpl.html
*
* Plugin home & Author URL:
* http://jquery-howto.blogspot.com