Skip to content

Instantly share code, notes, and snippets.

View territutich's full-sized avatar

Terri Tutich territutich

View GitHub Profile
@territutich
territutich / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@territutich
territutich / css_resources.md
Last active August 29, 2015 14:20 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@territutich
territutich / gf_create_coupon.php
Created December 17, 2015 23:15
portion of code to create GF coupons based on user registration
function bto_create_builder_coupon($user_id) { // need to pass user data to this function
if( is_callable( 'gf_coupons' ) ) {
$user = get_user_by( 'id', $user_id );
//$meta['gravityForm'] = $form_id ? $form_id : 0;
$form_id = '16'; // would like this to be 0. Have tried 0, '0', and specific form id. Nothing is working properly.
$meta['couponName'] = $user->user_login . date('M d, Y');
//$coupon_code = substr($user->user_firstname,0, 1) . substr($user->user_lastname, 0, 3) . date('ymd');
$meta['couponCode'] = strtoupper($user->user_login . date('ymd'));
$meta['couponAmountType'] = 'percentage';
$meta['couponAmount'] = 100;
/* Remove Query Strings from static resources */
/* Add to functions.php */
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
@territutich
territutich / woo-3-products.php
Created May 4, 2016 23:00
Change WooCommerce to 3 products per row
// Change number or products per row to 3
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
ini_set('log_errors','On');
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@territutich
territutich / block-xmlrpc
Created May 31, 2016 20:50
Add this to .htaccess to block xmlrpc.php helps to prevent brute force attacks on sites.
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
@territutich
territutich / archive-fellows.php
Last active July 6, 2016 13:58
Archive Template for Fellows Directory Original code from http://wpsites.net/web-design/basic-genesis-archive-page-template-for-custom-post-type/ Priority added for specificity.
<?php
/**
* @author Terri Orlowski
* @example http://torlowski.me/
* @copyright 2016 Terri Orlowski
*/
//* Remove the post meta function
remove_action( 'genesis_entry_footer', 'genesis_post_meta',6 );
@territutich
territutich / woo-featured-2-col.php
Created March 25, 2017 18:50
Woo 2 featured products two column
@territutich
territutich / mailchimp-rss-feed-block.html
Created May 15, 2017 18:42
MailChimp RSS Feed block in Regular Campaign
*|FEEDBLOCK:http://www.example.com/feed/|**|FEEDITEMS:[$count=3]|*
<h3><a href="*|FEEDITEM:URL|*">*|FEEDITEM:TITLE|*</a></h3>
&nbsp;
<div style="float:right; margin-left:15px;">*|FEEDITEM:IMAGE|*</div>
*|FEEDITEM:CONTENT_TEXT|*<br />
<br />
Read the entire post at <a href="*|FEEDITEM:URL|*">*|FEEDITEM:URL|*</a><br />
<br />
<br />