Skip to content

Instantly share code, notes, and snippets.

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

Noah U nucab

🏠
Working from home
  • Philippines
  • 01:45 (UTC +08:00)
  • LinkedIn in/nucab
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
add_filter( 'get_the_archive_title', function ($title) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
<?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 / gist:0c20178bc9328f3ac4b1
Created August 4, 2015 06:44
Perfect Full Page Background Image
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
https://css-tricks.com/perfect-full-page-background-image/
@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 -->