Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 ); | |
function woocommerce_custom_sales_price( $price, $product ) { | |
$percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 ); | |
return $price . sprintf( __(' Save %s', 'woocommerce' ), $percentage . '%' ); | |
} |
function mw_theme_categories( $context ) | |
{ | |
$args = array( 'taxonomy' => 'product_cat' ); | |
$terms = wp_get_post_terms( $context['post']->ID ,'product_cat', $args ); | |
foreach ($terms as $cat) { | |
if($cat->parent == 0){ | |
$out = '<div class="prodLabel prodLabel--' . strtolower( $cat->name ) . '">'; | |
$out .= "<a href='/product-category/$cat->slug'>$cat->name</a>"; | |
$out .= '</div>'; | |
echo $out; |
'use strict'; | |
var gulp = require('gulp'), | |
connect = require('gulp-connect'), | |
gulpLoadPlugins = require('gulp-load-plugins'), | |
cleanhtml = require('gulp-cleanhtml'), | |
dev = require('gulp-dev'), | |
browserSync = require('browser-sync'), | |
plugins = gulpLoadPlugins(), | |
webpack = require('webpack'), |
<?php /* Template Name: Login Page AA */ ?> | |
<?php get_header(); ?> | |
<!-- section --> | |
<section class="aa_loginForm"> | |
<?php global $user_login; | |
if(isset($_GET['login']) && $_GET['login'] == 'failed') | |
{ |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
#------------------------------------------ | |
# PANTHEON DEVELOPMENT WORKFLOW v1.01 | |
# Using the Pantheon CLI (terminus) v0.71 | |
#------------------------------------------ | |
# Authenticate with Pantheon. The first step, most of the time. | |
# This is a little insecure, as it lists your password here. But it's convenient. | |
alias pdw-auth='terminus auth login YOURPANTHEONEMAILADDRESS --password=YOURPANTHEONPASSWORD' | |
# Update your local Pantheon site aliases |
<?php | |
$contact = AWP_CTP_Model_Contact::get_instance( get_the_ID() ); | |
?> | |
<article id="post-<?php echo $contact->get_ID(); ?>"> | |
<?php if ( $contact->get_featured_image_url() ) : ?> | |
<div class="ecc-contact-image"> | |
<img class="th" src="<?php echo $contact->get_featured_image_url(); ?>" alt="<?php echo $contact->get_display_title(); ?>" title="<?php echo $contact->get_display_title(); ?>" /> |
<?php | |
class AWP_CTP_Model_Contact { | |
/** | |
* Gets an array of data for the object. Use this to get data to pass to the constructor. | |
* @param int $id | |
* @return array | |
*/ | |
public static function get_data( $id ) { |